Skip to content

Commit

Permalink
sq
Browse files Browse the repository at this point in the history
  • Loading branch information
jamietanna committed Jan 19, 2024
1 parent 1a711bc commit 3e25b53
Show file tree
Hide file tree
Showing 9 changed files with 281 additions and 105 deletions.
2 changes: 1 addition & 1 deletion internal/test/issues/issue-1378/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ version: "3.0.0"

paths:
/ping:
$ref: "common.yaml#/paths/~1ping"
$ref: "ping.yaml#/paths/~1ping"
10 changes: 5 additions & 5 deletions internal/test/issues/issue-1378/api/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 2 additions & 15 deletions internal/test/issues/issue-1378/common.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
version: "3.0.0"

paths:
/ping:
get:
responses:
200:
content:
application/json:
schema:
$ref: "#/components/schemas/PingResponse"

components:
schemas:
PingResponse:
type: object
properties:
message:
type: string
ID:
type: string
88 changes: 4 additions & 84 deletions internal/test/issues/issue-1378/common/common.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/test/issues/issue-1378/common/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ generate:
strict-server: true
models: true
output: common.gen.go
output-options:
skip-prune: true
20 changes: 20 additions & 0 deletions internal/test/issues/issue-1378/ping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# a separate spec to manage all things in the Ping domain
version: "3.0.0"

paths:
/ping:
get:
responses:
200:
content:
application/json:
schema:
$ref: "#/components/schemas/PingResponse"

components:
schemas:
PingResponse:
type: object
properties:
message:
$ref: "common.yaml#/components/schemas/ID"
9 changes: 9 additions & 0 deletions internal/test/issues/issue-1378/ping/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package: ping
generate:
gin-server: true
embedded-spec: true
strict-server: true
models: true
import-mapping:
common.yaml: github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1378/common
output: ping.gen.go
3 changes: 3 additions & 0 deletions internal/test/issues/issue-1378/ping/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package ping

//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../ping.yaml
Loading

0 comments on commit 3e25b53

Please sign in to comment.