Last active
April 13, 2018 16:46
-
-
Save CoditCompany/124c83c6194c66ab5ddb82665ae74cb5 to your computer and use it in GitHub Desktop.
Changes to OpenAPI interpretation in Azure API Management
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Gets the current health status of the API | |
/// </summary> | |
[HttpGet] | |
[Route("health")] | |
[SwaggerOperation("Get Health")] | |
[SwaggerResponse(HttpStatusCode.OK, "API is up & running")] | |
[SwaggerResponse(HttpStatusCode.InternalServerError, "API is not available")] | |
public IHttpActionResult Get() | |
{ | |
return Ok(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { ... } | |
}, | |
"host": "localhost:1337", | |
"schemes": ["https"], | |
"paths": { | |
"/api/v1/health": { | |
"get": { | |
"tags": ["Health"], | |
"summary": "Gets the current health status of the API", | |
"operationId": "Get Health", | |
"consumes": [], | |
"produces": ["application/json"], | |
"responses": { | |
"200": { | |
"description": "API is up & running" | |
}, | |
"500": { | |
"description": "API is not available" | |
} | |
} | |
} | |
} | |
}, | |
"definitions": { } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Get Health | |
/// </summary> | |
/// <remarks>Gets the current health status of the API</remarks> | |
[HttpGet] | |
[Route("health")] | |
[SwaggerOperation("get-health")] | |
[SwaggerResponse(HttpStatusCode.OK, "API is up & running")] | |
[SwaggerResponse(HttpStatusCode.InternalServerError, "API is not available")] | |
public IHttpActionResult Get() | |
{ | |
return Ok(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { ... } | |
}, | |
"host": "localhost:1337", | |
"schemes": ["https"], | |
"paths": { | |
"/api/v1/health": { | |
"get": { | |
"tags": ["Health"], | |
"summary": "Get Health", | |
"description": "Gets the current health status of the API", | |
"operationId": "get-health", | |
"consumes": [], | |
"produces": ["application/json"], | |
"responses": { | |
"200": { | |
"description": "API is up & running" | |
}, | |
"500": { | |
"description": "API is not available" | |
} | |
} | |
} | |
} | |
}, | |
"definitions": { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment