Skip to content

Instantly share code, notes, and snippets.

@joeydebreuk
Created September 1, 2022 13:35
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 joeydebreuk/0375b672cbf08a31118b2299bfbb99f2 to your computer and use it in GitHub Desktop.
Save joeydebreuk/0375b672cbf08a31118b2299bfbb99f2 to your computer and use it in GitHub Desktop.
{
components: {
schemas: {
HALLink: {
type: 'object',
properties: {
api: { type: 'string', example: 'https://egeniq.com/page' },
web: { type: 'string', example: 'https://egeniq.com/page' }
},
required: [ 'api', 'web' ]
},
InternalTextLink: {
type: 'object',
properties: {
type: { type: 'string', enum: [ 'text-link' ] },
text: { type: 'string' },
link: {
type: 'object',
properties: {
api: { type: 'string', example: 'https://egeniq.com/page' },
web: { type: 'string', example: 'https://egeniq.com/page' }
},
required: [ 'api', 'web' ]
}
},
required: [ 'type', 'text', 'link' ]
},
LoadMore: {
type: 'object',
properties: {
type: { type: 'string', enum: [ 'load-more' ] },
link: {
type: 'object',
properties: {
api: { type: 'string', example: 'https://egeniq.com/page' },
web: { type: 'string', example: 'https://egeniq.com/page' }
},
required: [ 'api', 'web' ]
}
},
required: [ 'type', 'link' ]
}
},
parameters: {}
}
}
{
openapi: '3.0.0',
info: { version: '1.0.0', title: 'My API', description: 'This is the API' },
servers: [ { url: 'v1' } ],
components: {
schemas: {
HALLink: { '$ref': '#/components/schemas/HALLink' },
InternalTextLink: { '$ref': '#/components/schemas/InternalTextLink' },
LoadMore: { '$ref': '#/components/schemas/LoadMore' }
},
parameters: {}
},
paths: {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment