Skip to content

Commit 20b60fc

Browse files
authored
Merge pull request #142 from urugator/patch-1
docs: fix basic example
2 parents ce66fc7 + 993e022 commit 20b60fc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The builder pattern, the TS compiler & the code-completion will guide you to add
1616
Minimal example to generate a 3.1 OAS compliant document:
1717

1818
```typescript
19-
import * from 'openapi3-ts/oas31'; // Pick `openapi3-ts/oas31` for 3.1.x (x)or pick `openapi3-ts/oas30` for 3.0.x
19+
import { OpenApiBuilder } from 'openapi3-ts/oas31'; // Pick `openapi3-ts/oas31` for 3.1.x (x)or pick `openapi3-ts/oas30` for 3.0.x
2020

2121
function buildOas() {
2222
const builder = OpenApiBuilder
@@ -29,15 +29,14 @@ function buildOas() {
2929
.addLicense({
3030
name: 'Apache 2.0',
3131
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
32-
}),
32+
})
3333
.addTitle('my title')
3434
.addPath('pet/{petId}', {
3535
get: {
3636
tags: ["pet"],
3737
summary: "Find pet by ID",
3838
description: "Returns a single pet",
39-
operationId: "getPetById",
40-
produces: ["application/json", "application/xml"]
39+
operationId: "getPetById"
4140
}
4241
})
4342
.addResponse('Created', {
@@ -49,9 +48,10 @@ function buildOas() {
4948
})
5049
.addParameter('id', {
5150
name: 'id',
52-
in: 'header' as ParameterLocation,
51+
in: 'header',
5352
schema: {
5453
$ref: '#/components/schemas/id'
54+
}
5555
});
5656
//...keep building
5757

0 commit comments

Comments
 (0)