Closed hkosova closed 6 years ago
Spec: https://gist.githubusercontent.com/hkosova/94b866556692cd099a8720e9b4362b4f/raw/fb668ac8e383b7bf372fb85b03f928386c56ed5f/schema-examples.yaml
definitions: User: type: object properties: id: type: integer readOnly: true example: 42 name: type: string example: Arthur Dent friend_ids: type: array items: type: integer example: 8 example: [3, 4, 5] required: - id - name example: id: 1 name: Trillian ArrayOfUsers: type: array items: $ref: '#/definitions/User' example: - id: -1 name: Marvin the Paranoid Android - id: 1000000 name: Zaphod Beeblebrox friends: [15]
Converted spec: http://oai.swagger.io/api/convert?url=https://gist.githubusercontent.com/hkosova/94b866556692cd099a8720e9b4362b4f/raw/fb668ac8e383b7bf372fb85b03f928386c56ed5f/schema-examples.yaml
Expected result:
"components": { "schemas": { "User": { "required": [ "id", "name" ], "type": "object", "properties": { "id": { "type": "integer", "readOnly": true, "example": 42 // <------------ }, "name": { "type": "string", "example": "Arthur Dent" // <------------ }, "friend_ids": { "type": "array", "items": { "type": "integer", "example": 8 // <------------ }, "example": [3, 4, 5] // <------------ } } }, "ArrayOfUsers": { "type": "array", "items": { "$ref": "#/components/schemas/User" }, "example": [ // <------------ { "id": -1, "name": "Marvin the Paranoid Android" }, { "id": 1000000, "name": "Zaphod Beeblebrox", "friends": [15] } ] } } }
Fixed!
Spec: https://gist.githubusercontent.com/hkosova/94b866556692cd099a8720e9b4362b4f/raw/fb668ac8e383b7bf372fb85b03f928386c56ed5f/schema-examples.yaml
Converted spec: http://oai.swagger.io/api/convert?url=https://gist.githubusercontent.com/hkosova/94b866556692cd099a8720e9b4362b4f/raw/fb668ac8e383b7bf372fb85b03f928386c56ed5f/schema-examples.yaml
Expected result: