Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
connected to #1531
This PR:
responsesproperty on a Controller methods OpenAPI Spec if one isn't givenx-ts-typeproperty that can be used to specify the schema of a response object. Can also be used to specify the type of array items.generate-schemato have a single function to resolve schema from a Function.responsesobject based on the Modelexample-todo/example-todo-listto setresponsesobjectThis PR introduces:- a new@responsesdecorator that can be used to decorate a Controller method with the appropriate OpenAPI responses object.- for controller's not decorated with this property, or via the@operationand family (get, post, etc.) of decorators, we generate a default responses object to be OpenAPI 3.0 compliant-controller-specgenerator can set Model as$reffor{schema: Model}or {schema: {type: 'array', items: Model}}}in the responses object.~ ~- Decorateexample-todowith@Responses()` decorator as an example. Once this PR is agreed upon, a follow up PR/commit will add decoration to CLI template + remaining examples + docsChecklist
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated