forked from oapi-codegen/oapi-codegen
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(): v2.1.0 upstream #3
Closed
Closed
Conversation
This file contains 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
To give us a more consistent set of release notes, especially now we're using multi-repo setup, we can use it to build our upcoming release's changelog with a centrally configured + managed configuration.
…ly (oapi-codegen#1315) Corresponding with changes in the runtime package, we want to ensure we let the (newly added) `BindStyledParameterWithOptions` function knows whether a parameter is required, to not error when an empty value is provided. Closes oapi-codegen#954.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…i-codegen#1385) Right now, we're only generating code for multipart requests when the media type is a `multipart/form-data`, which means that other multipart types, like `multipart/related` do not correctly generate. We should amend this, generating code that validates the media type provided and handling the request. Closes oapi-codegen#1381.
Although not _technically_ a valid extension to JSON according to [the media type definition], it's got a number of services using it for a `v` or `version` parameter, so we should support this as a valid option. This makes sure that we parse it as a valid media type, performing the same checks as we did before by ignoring the parameters. [the media type definition]: https://www.iana.org/assignments/media-types/application/json
When using the strict server, binding a request body that is JSON compatible - but not `application/json` - will result in errors. We can therefore correctly bind the body using `ShouldBindJSON`. Closes oapi-codegen#1298.
As part of oapi-codegen/runtime v1.1.0, we renamed these for common initialisms and deprecated the existing methods, which means this may show up as a warning in IDEs or tooling.
As part of follow-up changes we're making changes to `GoTypeDef`, so it's handy to have some confidence that the existing behaviour isn't affected by the changes. Co-authored-by: Ashutosh Kumar <[email protected]>
As part of oapi-codegen#1039, we've created a new library `oapi-codegen/nullable`, which allows tracking whether: - a field is not sent - a field is sent with an explicit `null` - a field is sent with an explicit value This introduces an opt-in `output-options` flag, `nullable-type`, which can generate the `nullable.Nullable` types. This is opt-in, as existing code will break due to the signature change, as well as a behaviour change. Closes oapi-codegen#1039. Co-authored-by: Ashutosh Kumar <[email protected]>
As raised in oapi-codegen#1426, it isn't immediately clear how you could use the import mapping for a URL, so we should amend `externalref` to make it super clear. Closes oapi-codegen#1426.
The current approach doesn't often work when generating types that are in external packages, unless that package is also a strict server's definition, which isn't always the case.
As part of follow-up changes, we'll need it, and it's handy to keep this consistent with other types that have this.
In the case that we're referencing a type defined in an external package, using an alias here results in build errors i.e.: ./api.gen.go:93:7: cannot define new methods on non-local type common.TypeNameHere Instead, we can make sure we only alias when there's not an external reference in use, using the new `Schema.IsExternalRef` function.
Co-authored-by: Jamie Tanna <[email protected]>
…en#1414) Fixes indentation for "Registering handlers" example code for Gin. Fixes indentation in README example code.
As noted in oapi-codegen#1247, in some cases it can be useful to have arrays defined as a concrete type, not a type alias, so you are able to extend them with methods. This produces a new opt-in output-option, `disable-type-aliases-for-type`, which can be used to control this behaviour Right now, we only want to add support for `array`s, but the configuration is extensible in the future. This also introduces a test case to demonstrate the capabilities. We need to introduce a `sliceContains` method to simplify this lookup, as we don't yet have `slices.Contains` due to the Go versions we're targeting.
As noted in oapi-codegen#428, there are some cases where it can be useful to set the field ordering. This adds support for the `x-order` extension used by other OpenAPI parsers and generators, and ensures that we return keys sorted by that order, if present. This also adds a relevant test case + unit tests to validate functionality. Closes oapi-codegen#428. Co-authored-by: Filinto Duran <[email protected]> Signed-off-by: Filinto Duran <[email protected]> Co-authored-by: Andrew Rusakow <[email protected]> Co-authored-by: Jamie Tanna <[email protected]>
As noted in oapi-codegen#1378, there are cases where a complex set of `$ref`s between multiple files can lead to broken generated code, which does not correctly import the package that has been prepared for the external reference. We can handle this by looking up any references, where there is a `.Ref` passed into the type, and then iterate through relevant children. This requires we handle the updating in-place for these by using a bit of pointer + indexing fun. This also adds a relevant test case to validate the fix. Closes oapi-codegen#1378.
Signed-off-by: Yousuf Jawwad <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.