Skip to content

Commit

Permalink
Use OpenAPI Operation block
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Feb 28, 2025
1 parent 99ac594 commit 78bc7bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/tall-dodos-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@gitbook/integration-openapi': patch
'@gitbook/document': patch
---

Add support for openapi-operation block
2 changes: 1 addition & 1 deletion integrations/openapi/src/parser/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function getGroupDocument(args: {
return doc.document([
...(group.tag ? getTagDescriptionNodes(group.tag) : []),
...operations.map((operation) => {
return doc.openapi({
return doc.openapiOperation({
ref: { kind: 'openapi', spec: specContent.slug },
method: operation.method,
path: operation.path,
Expand Down
2 changes: 2 additions & 0 deletions packages/document/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export const images = blockFactory<api.DocumentBlockImages>('images');
export const divider = voidBlockFactory<api.DocumentBlockDivider>('divider');
export const file = voidBlockFactory<api.DocumentBlockFile>('file');
export const openapi = voidBlockFactory<api.DocumentBlockOpenAPI>('swagger');
export const openapiOperation =
voidBlockFactory<api.DocumentBlockOpenAPIOperation>('openapi-operation');

/**
* Code blocks.
Expand Down

0 comments on commit 78bc7bc

Please sign in to comment.