File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ The builder pattern, the TS compiler & the code-completion will guide you to add
16
16
Minimal example to generate a 3.1 OAS compliant document:
17
17
18
18
``` 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
20
20
21
21
function buildOas() {
22
22
const builder = OpenApiBuilder
@@ -29,15 +29,14 @@ function buildOas() {
29
29
.addLicense ({
30
30
name: ' Apache 2.0' ,
31
31
url: ' http://www.apache.org/licenses/LICENSE-2.0.html'
32
- }),
32
+ })
33
33
.addTitle (' my title' )
34
34
.addPath (' pet/{petId}' , {
35
35
get: {
36
36
tags: [" pet" ],
37
37
summary: " Find pet by ID" ,
38
38
description: " Returns a single pet" ,
39
- operationId: " getPetById" ,
40
- produces: [" application/json" , " application/xml" ]
39
+ operationId: " getPetById"
41
40
}
42
41
})
43
42
.addResponse (' Created' , {
@@ -49,9 +48,10 @@ function buildOas() {
49
48
})
50
49
.addParameter (' id' , {
51
50
name: ' id' ,
52
- in: ' header' as ParameterLocation ,
51
+ in: ' header' ,
53
52
schema: {
54
53
$ref: ' #/components/schemas/id'
54
+ }
55
55
});
56
56
// ...keep building
57
57
You can’t perform that action at this time.
0 commit comments