Skip to content

Instantly share code, notes, and snippets.

@rjvdboon
Created January 26, 2019 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjvdboon/d6c293a3a93666c41d1def76917b6fb7 to your computer and use it in GitHub Desktop.
Save rjvdboon/d6c293a3a93666c41d1def76917b6fb7 to your computer and use it in GitHub Desktop.
{
"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