Challenge Overview

 

Project Overview

The OData project is going to develop a powerful API layer (with a robust data model) which will be used to provision select business data.
 The main purpose is twofold:

  1. Create OData (version 4+) compliant REST APIs to allow access to the specified data.
  2. The code for the services must be generated (and potentially re-generated) via template-driven code generators.

Currently the client is using SOAP based APIs that are antiquated and cumbersome; what the client needs are flexible data APIs that can handle the needs required for modern applications and consumers.  
The client wants to use Representational State Transfer (REST) as this is the architectural style suited for these modern applications and purposes.

In this assembly you will take as input the last assembly, which is attached with this competition, and will improve the project in the following areas (full details are in the "Your Assembly Task:" section below)

  1. Create a packaging solution using either VSIX package and/or NuGet transformation.
  2. Add Swagger support using Swashbuckle.OData
  3. Add support for Post, Put and Delete including validation in the .tt template for controllers
  4. Provide project readme file to be included in the packaging solution with the project documentation.

Competition Task Overview

Your task will be to take the existing Assembly and polish it with reference to packaging, swagger documentation (REST), additional support for POST, PUT, and DELETE operations

Please have a look at the provided Assembly [OData REST API Layer - Main Assembly v1.0 FINAL.zip] as well as some background documentation in the form of the SDS and the TCUML (for reference only)

We have also attached the startup POC if you want to walk through the evolution of the project to understand it better.

Assembly Source code considerations:

This is your main input and this is what you will be working with and adding to. Make sure to ask any questions in the forums if you have any.

POC:

The POC source code has been attached with this competition. This was the first draft of the approach and you can use it as a reference to understand the assembly code better.

The main purpose is to take the code and convert it so that it will create the REST services through a configurable template. Make sure to read the architecture which outlines the process of what this is going to achieve. 

Your Assembly Task:

This assembly will improve the input assembly as follows:

  1. Create a packaging solution using Visual Studio VSIX package and/or NuGet transformation.
    • With VSIX project eithr template or item template is acceptable as long as this strategy can incorporate all the code and dependencies including Nuget packages inside.
    • Feel free to use forums early in the challenge to ask questions and/or discuss your approach.
    • Along with the submission, provide reasoning for your choice of packaging.
    • Provide also a step-by-step process on how would it work for a developer. 
    • Provide project readme file to be included in the packaging solution with the project documentation.
  2. Add a config key to the t4 template that controls whether to generate Put, Post and Delete in addition to Get(s). This switch would control whether generated controllers support read-only APIs or read-write.
  3. Change the web.config to ensure log4net uses rolling flat files. Feel free to use any default configuration like rolling every 5 MB etc...
  4. Add a logger.debug or verbose statement for each enter and exit method of the controller. This should be done in a generic fashion (like in global.asax or so). This should use default configuration of log4net so that it only runs when the log switch is set to debug (or verbose). Entry and exit should be marked with the timestamp.
  5. Add Swagger support using Swashbuckle.OData
    • Swagger documentation should include all the inline XML comments from the controllers.
    • Swagger documentation should include all the navigational properties.
    • This service will be hosted internally. If this doesn't work with the default Swagger validator, it should be either disabled or alternate solution should be suggested.
  6. In the generated web.config add the following:

disable MIME sniffing

<system.webServer>
    <httpProtocol>
        <customHeaders>
            <add name="X-Content-Type-Options" value="nosniff"/>
        </customHeaders>
    </httpProtocol>
</system.webServer>


Set 'httponlycookies' to true

<system.web>
    <httpCookies httpOnlyCookies="true"/>

Platform Requirements:

  1. .Net 4.6 and Web API frameworks should be used to build the APIs
  2. Data Access Layer should be built with Entity Framework 6.
  3. Entities will be POCOs
  4. C#
  5. OData ver. 4+
  6. T4 template (Entity Framework)
  7. REST
  8. JSON
  9. Code must have proper level of logging in place.
  10. Swashbuckle 5.3.1 https://www.nuget.org/packages/swashbuckle (NOTE: Swashbuckle.OData should be used.)
  11. Swagger

Additionally the following will be utilized:

  1. Moq
  2. Visual Studio 2015 would be the choice of IDE.


Final Submission Guidelines

  1. Source code and configuration files.
  2. Deployment guide to configure and verify the application.
  3. DDL scripts as needed for any data setup.
  4. Your code will have to be tested.

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30053057