FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: handle untyped strict JSON responses by Boulea7 · Pull Request #2514 · oapi-codegen/oapi-codegen · GitHub

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .go  (9) .tmpl  (4) .yaml  (4) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# yaml-language-server: $schema=../../../../../configuration-schema.json
package: spec_other_fiber
generate:
fiber-server: true
strict-server: true
models: true
import-mapping:
./spec-base.yaml: "github.com/oapi-codegen/oapi-codegen/v2/internal/test/references/multipackage/response_cast/gen/spec_base"
output: gen/spec_other_fiber/issue.gen.go
output-options:
skip-prune: true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# yaml-language-server: $schema=../../../../../configuration-schema.json
package: spec_other_iris
generate:
iris-server: true
strict-server: true
models: true
import-mapping:
./spec-base.yaml: "github.com/oapi-codegen/oapi-codegen/v2/internal/test/references/multipackage/response_cast/gen/spec_base"
output: gen/spec_other_iris/issue.gen.go
output-options:
skip-prune: true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// Regression fixture for https://github.com/oapi-codegen/oapi-codegen/issues/2010.
// Regression fixture for:
// - https://github.com/oapi-codegen/oapi-codegen/issues/1328
// - https://github.com/oapi-codegen/oapi-codegen/issues/2010
//
// The base spec defines components/responses/400 with a JSON body. The "other"
// spec references that response via an external $ref. With strict-server
// enabled in both packages, the embedded response field name must agree across
// packages so cross-package response casts compile.
// The base spec defines reusable responses with concrete, untyped, pointer,
// and header-bearing JSON bodies. The "other" specs reference those responses
// via external $refs. With strict-server enabled in both packages, the imported
// response envelope must remain embedded so cross-package response casts compile.
package responsecast

//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.base.yaml spec-base.yaml
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.other.yaml spec-other.yaml
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.other-fiber.yaml spec-other.yaml
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.other-iris.yaml spec-other.yaml

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

Loading

Back | FazBrowse Home | New Git URL