Created
January 26, 2019 23:54
-
-
Save rjvdboon/d6c293a3a93666c41d1def76917b6fb7 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
{ | |
"openapi" : "3.0.1", | |
"info" : { | |
"title" : "Test API with base-middle-leaf inheritance", | |
"description" : "Test API", | |
"version" : "1.0.0" | |
}, | |
"servers" : [ { | |
"url" : "https://example.com/test/api/v1" | |
} ], | |
"paths" : { | |
"/detailed" : { | |
"get" : { | |
"tags" : [ "Detailed" ], | |
"summary" : "Get Detailed", | |
"description" : "Returns Detailed.", | |
"operationId" : "getDetailed", | |
"responses" : { | |
"200" : { | |
"description" : "detailed.", | |
"content" : { | |
"application/json" : { | |
"schema" : { | |
"$ref" : "#/components/schemas/Detailed" | |
} | |
} | |
} | |
}, | |
"default" : { | |
"description" : "Unexpected error.", | |
"content" : { | |
"application/json" : { | |
"schema" : { | |
"$ref" : "#/components/schemas/Fault" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"components" : { | |
"schemas" : { | |
"Meta" : { | |
"type" : "object", | |
"properties" : { | |
"id" : { | |
"type" : "integer", | |
"description" : "The unique identifier." | |
}, | |
"resource_state" : { | |
"type" : "integer", | |
"description" : "Resource state, indicates level of detail. Possible values: 1 -> \"meta\", 2 -> \"summary\", 3 -> \"detail\"" | |
}, | |
"name" : { | |
"type" : "string", | |
"description" : "The name." | |
} | |
} | |
}, | |
"Summary" : { | |
"allOf" : [ { | |
"$ref" : "#/components/schemas/Meta" | |
}, { | |
"type" : "object", | |
"properties" : { | |
"url" : { | |
"type" : "string", | |
"description" : "TheURL." | |
} | |
} | |
} ] | |
}, | |
"Detailed" : { | |
"allOf" : [ { | |
"$ref" : "#/components/schemas/Summary" | |
}, { | |
"type" : "object", | |
"properties" : { | |
"owner" : { | |
"type" : "boolean", | |
"description" : "Whether the currently logged-in user is the owner." | |
} | |
} | |
} ] | |
}, | |
"Error" : { | |
"type" : "object", | |
"properties" : { | |
"code" : { | |
"type" : "string", | |
"description" : "The code associated with this error." | |
}, | |
"field" : { | |
"type" : "string", | |
"description" : "The specific field or aspect of the resource associated with this error." | |
}, | |
"resource" : { | |
"type" : "string", | |
"description" : "The type of resource associated with this error." | |
} | |
} | |
}, | |
"Fault" : { | |
"type" : "object", | |
"properties" : { | |
"errors" : { | |
"type" : "array", | |
"description" : "The set of specific errors associated with this fault, if any.", | |
"items" : { | |
"$ref" : "#/components/schemas/Error" | |
} | |
}, | |
"message" : { | |
"type" : "string", | |
"description" : "The message of the fault." | |
} | |
}, | |
"description" : "Encapsulates the errors that may be returned from the API." | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment