Update generating_oas_for_http_apis.mdx (#191037)

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
This commit is contained in:
Lisa Cawley 2024-08-23 10:21:28 -07:00 committed by GitHub
parent 9ab690e23b
commit 753f3d9dd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,9 +90,17 @@ import { fooResource } from '../../schemas/v1';
// Note: this response schema is instantiated lazily to avoid creating schemas that are not needed in most cases!
const fooResourceResponse = () => {
return schema.object({
id: schema.string({ maxLength: 20 }),
name: schema.string(),
createdAt: schema.string(),
id: schema.string({
maxLength: 20,
meta: { description: 'Add a description.' }
}),
name: schema.string({ meta: { description: 'Add a description.' } }),
createdAt: schema.string({
meta: {
description: 'Add a description.',
deprecated: true, // An indicator that the property is deprecated
},
}),
})
}
@ -106,6 +114,8 @@ function registerFooRoute(router: IRouter, docLinks: DoclinksStart) {
access: 'public',
summary: 'Create a foo resource'
description: `A foo resource enables baz. See the following [documentation](${docLinks.links.fooResource}).`,
tags: ['oas-tag:my tag'], // Each operation must have a tag that's used to group similar endpoints in the docs
deprecated: true // An indicator that the operation is deprecated
})
.addVersion({
version: '2023-10-31',