You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I test the online hub https://app.swaggerhub.com use the yaml code following, but I get the unexpected generation at right side of the page (like the following screenshot). I think it will generated like the document (https://swagger.io/docs/specification/describing-request-body/) as the example in requestBody.content. will override which defined in schema but it seems like the example I defined makes no sense.
paths:
/users:
post:
summary: Adds a new userrequestBody:
content:
application/json: # Media typeschema: # Request body contents$ref: '#/components/schemas/User'# Reference to an objectexample: # Child of media type because we use $ref above# Properties of a referenced objectid: 10name: Jessica Smithresponses:
'200':
description: OKcomponents:
schemas:
# basic data structureUser:
type: objectproperties:
id:
type: integername:
type: string
Expected Behavior
generate example object like { id: 10, name: Jessica Smith}
Current Behavior
generate a {id: 0, name: "string"} object
Waiting for your help, please.
The text was updated successfully, but these errors were encountered:
Demonstration API definition
I test the online hub https://app.swaggerhub.com use the yaml code following, but I get the unexpected generation at right side of the page (like the following screenshot). I think it will generated like the document (https://swagger.io/docs/specification/describing-request-body/) as the example in requestBody.content. will override which defined in schema but it seems like the example I defined makes no sense.
https://app.swaggerhub.com/apis/liu946/ssp/1.0.0
Expected Behavior
generate example object like { id: 10, name: Jessica Smith}
Current Behavior
generate a {id: 0, name: "string"} object
Waiting for your help, please.
The text was updated successfully, but these errors were encountered: