-
Notifications
You must be signed in to change notification settings - Fork 288
OpenAPI - Distinguish between stored procedure parameters and result set columns #1551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…arameters and result set columns for the request and response payloads.
…n. update package versions, and add tsql storedprocedure creation for use in tests.
Aniruddh25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Left few minor suggestions.
src/Service.Tests/OpenApiDocumentor/StoredProcedureGeneration.cs
Outdated
Show resolved
Hide resolved
src/Service.Tests/OpenApiDocumentor/StoredProcedureGeneration.cs
Outdated
Show resolved
Hide resolved
src/Service.Tests/OpenApiDocumentor/StoredProcedureGeneration.cs
Outdated
Show resolved
Hide resolved
|
you mentioned in PR description that |
…sserts the necessary characteristics of a request and response body . updates comments.
Request bodies in those two request types are not convention per HTTP spec:
Relevant text with my annotation in square brackets:
|
…cenarios under test: validating input parameters and json data types and output result set columns and their json data types. Removes new SP's added from the .sql deploy file.
src/Service.Tests/OpenApiDocumentor/StoredProcedureGeneration.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Aniruddh Munde <[email protected]>
…pace collision/errors.
severussundar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Nit: The comment here:
|
|
It might not be relevant for this PR but I think we default stored procedures to atleast support POST operation if no method is defined. This doesn't seem to be the case here:
|
Good catch. The sp default methods are added (POST) when |
Why make this change?
What is this change?
How was this tested?
OpenAPI document example
An example OpenAPI document which helps visualize how the parsing works. Irrelevant fields were removed.
{ "openapi": "3.0.1", "paths": { "/sp1": { "get": {"..."}, "post": { "tags": [ "sp1" ], "description": "Executes a stored procedure.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/sp1_sp_request" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "properties": { "value": { "type": "array", "items": { "$ref": "#/components/schemas/sp1_sp_response" } } } } } } }, "400": { "description": "BadRequest" } } } } }, "components": { "schemas": { "sp1_sp_request": { "type": "object", "properties": { "inputName": { "type": "string", "format": "" } } }, "sp1_sp_response": { "type": "object", "properties": { "outputName": { "type": "string", "format": "" } } } } } }