Created
May 2, 2025 10:40
-
-
Save bogdan/f5fbf0f5940d5540b60ca086beef3fea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "1.0.0", | |
"title": "Sample API with x-nullable nested schema" | |
}, | |
"host": "api.example.com", | |
"basePath": "/v1", | |
"schemes": ["https"], | |
"paths": { | |
"/items/{id}": { | |
"get": { | |
"summary": "Get a specific item", | |
"parameters": [ | |
{ | |
"name": "id", | |
"in": "path", | |
"required": true, | |
"type": "string" | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "The requested item", | |
"schema": { | |
"$ref": "#/definitions/Item" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"definitions": { | |
"Item": { | |
"type": "object", | |
"required": ["name", "active_listing", "description"], | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"description": { | |
"type": "string", | |
"x-nullable": true | |
}, | |
"active_listing": { | |
"x-nullable": true, | |
"$ref": "#/definitions/Listing" | |
} | |
} | |
}, | |
"Listing": { | |
"type": "object", | |
"required": ["price", "currency", "seller"], | |
"properties": { | |
"price": { | |
"type": "number", | |
"format": "float" | |
}, | |
"currency": { | |
"type": "string" | |
}, | |
"seller": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment