oapi-codegen
oapi-codegen copied to clipboard
Generate Go client and server boilerplate from OpenAPI 3 specifications
In larger OpenAPI specs it is useful to split up components into multiple files and use [`$ref`](https://swagger.io/docs/specification/using-ref/) to "stitch" the spec together. This doesn't quite work when generating models, full...
This PR refactors `codegen.IsPredeclaredGoIdentifier` implementation to use the function [`doc.IsPredeclared`](https://pkg.go.dev/go/doc#IsPredeclared) from std.
This PR adds a new generic function `codegen.SortedKeys` to be used instead of specific `SortedPathsKeys`, `SortedOperationsKeys`, `SortedResponsesKeys`, `SortedHeadersKeys`, `SortedContentKeys`, `SortedStringKeys`, `SortedParameterKeys`, `SortedRequestBodyKeys`, `SortedSecurityRequirementKeys`.
This PR refactors the code to utilize the generic function `sliceContains` from the `pkg/codegen` package. Upon migration to Go 1.21, `sliceContains` can be substituted with [slices.Contains](https://pkg.go.dev/slices#Contains).
From the Go specification [^1]: > "3. If the map is nil, the number of iterations is 0." Therefore, we don't need the `nil` checks for merging the `Extensions`. Just...
If the schema is existed in content in operation object and describes array of object with additionalProperties, code generation is failed. Test data is in https://github.com/ShouheiNishi/oapi-codegen/commit/81494c12c605e380ea880d231767a6fe39c4ba1a. ``` $ git status...
Adding support of three naming styles: * new - with initialisms like MyHTTPHandlerForAPI * old - with simple camel case like MyHttpHandlerForApi By the steps of https://github.com/deepmap/oapi-codegen/pull/749 but without breaking...
https://github.com/deepmap/oapi-codegen/issues/1121 reports that use of AnyOf inline generates invalid go code for client (struct type names starting with a number). This PR fixes 2 issues: 1. When status code is...
## Short Description Allow primitive types (ints, floats, string types) to be replaced with an option, `primitive-mapping`, in the YAML configuration. ## Motivation Sometimes it is desirable to use a...