Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generating_oas_for_http_apis.mdx #191037

Merged
merged 3 commits into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions dev_docs/tutorials/generating_oas_for_http_apis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
}),
})
}

Expand All @@ -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',
Expand Down