Skip to content

Commit ffe428b

Browse files
authored
issue958 (oapi-codegen#959)
1 parent 0d7287e commit ffe428b

8 files changed

Lines changed: 337 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package: issue958
2+
generate:
3+
client: true
4+
output: issue.gen.go
5+
output-options:
6+
skip-prune: true
7+
import-mapping:
8+
./pkga/spec.yaml: github.com/deepmap/oapi-codegen/internal/test/issues/issue-958/pkga
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package issue958
2+
3+
//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml

internal/test/issues/issue-958/issue.gen.go

Lines changed: 234 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package: pkga
2+
generate:
3+
echo-server: false
4+
client: false
5+
models: true
6+
embedded-spec: false
7+
output-options:
8+
skip-prune: true
9+
output: responses.gen.go
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package pkga
2+
3+
//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml

internal/test/issues/issue-958/pkga/responses.gen.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
openapi: 3.0.2
2+
info:
3+
version: '0.0.1'
4+
title: example
5+
description: |
6+
Make sure client with responses can reference external responses
7+
paths:
8+
/example:
9+
get:
10+
operationId: exampleGet
11+
responses:
12+
'200':
13+
description: "OK"
14+
content:
15+
'application/json':
16+
schema:
17+
$ref: '#/components/schemas/Document'
18+
components:
19+
responses:
20+
200:
21+
description: "OK"
22+
content:
23+
'application/json':
24+
schema:
25+
$ref: '#/components/schemas/Document'
26+
schemas:
27+
Document:
28+
type: object
29+
properties:
30+
fields:
31+
type: object
32+
additionalProperties:
33+
$ref: '#/components/schemas/Value'
34+
Value:
35+
type: object
36+
properties:
37+
stringValue:
38+
type: string
39+
arrayValue:
40+
$ref: '#/components/schemas/ArrayValue'
41+
ArrayValue:
42+
type: array
43+
items:
44+
$ref: '#/components/schemas/Value'
45+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
openapi: 3.0.2
2+
info:
3+
version: '0.0.1'
4+
title: example
5+
description: |
6+
Make sure client with responses can reference external responses
7+
paths:
8+
/example:
9+
get:
10+
operationId: exampleGet
11+
responses:
12+
200:
13+
$ref: "./pkga/spec.yaml#/components/responses/200"
14+

0 commit comments

Comments
 (0)