Skip to content

Commit e0b1bea

Browse files
authored
Use OpenAPI Operation block (#732)
Use and expose OpenAPI Operation block
1 parent 99ac594 commit e0b1bea

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

.changeset/tall-dodos-trade.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@gitbook/integration-openapi': patch
3+
'@gitbook/document': patch
4+
---
5+
6+
Add support for openapi-operation block

integrations/openapi/src/parser/group.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('#getGroupDocument', () => {
5050
},
5151
isVoid: true,
5252
object: 'block',
53-
type: 'swagger',
53+
type: 'openapi-operation',
5454
});
5555
});
5656

@@ -118,7 +118,7 @@ describe('#getGroupDocument', () => {
118118
},
119119
isVoid: true,
120120
object: 'block',
121-
type: 'swagger',
121+
type: 'openapi-operation',
122122
});
123123
});
124124
});

integrations/openapi/src/parser/group.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function getGroupDocument(args: {
1717
return doc.document([
1818
...(group.tag ? getTagDescriptionNodes(group.tag) : []),
1919
...operations.map((operation) => {
20-
return doc.openapi({
20+
return doc.openapiOperation({
2121
ref: { kind: 'openapi', spec: specContent.slug },
2222
method: operation.method,
2323
path: operation.path,

packages/document/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export const images = blockFactory<api.DocumentBlockImages>('images');
3838
export const divider = voidBlockFactory<api.DocumentBlockDivider>('divider');
3939
export const file = voidBlockFactory<api.DocumentBlockFile>('file');
4040
export const openapi = voidBlockFactory<api.DocumentBlockOpenAPI>('swagger');
41+
export const openapiOperation =
42+
voidBlockFactory<api.DocumentBlockOpenAPIOperation>('openapi-operation');
4143

4244
/**
4345
* Code blocks.

0 commit comments

Comments
 (0)