How to provide JSON response schema?
See original GitHub issue@ApiResponse({ status: 201, description: 'Creates new player object.' })
Only (I think) allows for the status and description (plus some other fields). How can I implicitly or explicitly (^^) force SwaggerModule
to show the JSON that will be returned?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Testing and validating API responses with JSON Schema
In this post, I'll walk-through an example of using Assertible to create a test that validates an API response against a JSON Schema....
Read more >Getting Started Step-By-Step - JSON Schema
To start a schema definition, let's begin with a basic JSON schema. We start with four properties called keywords which are expressed as...
Read more >JSON - Schema - Tutorialspoint
JSON - Schema, JSON Schema is a specification for JSON based format for defining the structure of JSON data. It was written under...
Read more >How to Validate Your JSON Using JSON Schema
JSON Schema is a JSON-based format for defining the structure of JSON data. It provides a contract for what JSON data is required...
Read more >JSON Schema Examples Tutorial - MongoDB
To add an object inside an object in JSON format, we use nested data structure. Creating subschemas for Nested objects work quite similarly...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
But that’s the input? For POST I use
@ApiModelProperty
in the.dto
files. I mean the output from the API. My API is connected via TypeORM to PostgreSQL.In Swagger UI I can see that
CreateUserDto
is used as a request body, that’s great. Should I create a similar class for output? Or is it somehow possible to derive the output from theUser
(TypeORM) object?Hi @galkowskit, Use
type
property. Pass there a class with properties annotated with@ApiModelProperty()