oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Generate Go client and server boilerplate from OpenAPI 3 specifications

Results 633 oapi-codegen issues
Sort by recently updated
recently updated
newest added

# Strict Server mode does not respect optional requestBody ## Description When using strict-server generation mode, the generated code does not properly handle optional request bodies (`required: false`). The generated...

I noticed that `requestBody.required` wasn't being respected and requests without a body were failing with an `[EOF]` error even though required was set to false. This PR is a tentative...

Resolves: #1536 This is a new PR for previously opened PR: https://github.com/oapi-codegen/oapi-codegen/pull/1582, integrating all go template functions from `sprig` library.

Hi, i'm trying to use generated client, but i'm getting this error: `error formatting 'request': unsupported type []gen_client.PaymentQueryRequestCurrencies` Here are my code and specs: openapi spec: ``` "/some/path/foo/bar": { "get":...

Currently oapi-codegen doesn't merge property definitions when combining schemas with `allOf` and instead takes the complete property from the last one it sees: https://github.com/oapi-codegen/oapi-codegen/blob/0d94f2f2015e5fec2cd66273eeb8eff7d1f86bc1/pkg/codegen/merge_schemas.go#L203 This means we can't create a...

# Fix Missing Discriminator Mappings When Multiple Values Map to Same Schema ## Problem When an OpenAPI spec has multiple discriminator values that map to the same schema type, the...

Edit: it seems #1239 is the same issue. #972 and #1192 are possibly same issue. Generated code for enum in the components/responses refers undefined type. Here is the minimal spec...

Given a schema such as: ```json "MyModel": { "type": "object", "additionalProperties": { "nullable": true }, "properties": { "blabla": { "type": "string" } } } ``` This type will be generated:...

Error: Cannot use 'value' (type []string) as the type string The Problem is that the generated code line: `if value, found := headers[http.CanonicalHeaderKey("Authorization")]; found {` The value is the **wrong...

_Example: https://github.com/oapi-codegen/oapi-codegen/pull/2096_ I noticed when using this generator that when attempting to use the "client with response", the returned type is busted. In particular, it's because there are two `type`s...