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
拉取了 deepmap/master 上游,把 shanbay fork 里新增的嵌套 struct 功能改为了可选参数 #6
Merged
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
PR 258 broke generated code when the security scheme is an invalid Go identifier. Sanitize the name as a quick fix.
… echo as well (oapi-codegen#315) * add missing github.com/labstack/echo/v4 * add missing go.sum entry for golang.org/x/time/rate * tidy up go.mod
* Fix typo * Update templates.gen.go * fix
- `strconv.FormatFloat` was using 64 bitSize for both float32 and float64 - float32 should use 32 bitSize (https://golang.org/src/strconv/ftoa.go?s=1697:1760#L37) - this conversion caused a bug when you send pointer *float32 e.g. 1.05, you get something like 1.0499999523162842
* Upgrade Chi * Add line back * Go mod tidy Co-authored-by: Marcin Romaszewicz <47459980+deepmap-marcinr@users.noreply.github.com>
This ensures the generated constants are output in a deterministic order.
…nce. (oapi-codegen#308) It fixes the following case: $ cat main.yml: ... elements: type: array items: $ref: './schemas/items.yml' $ cat ./schemas/items.yml type: object properties: id: type: integer format: int64 name: type: string Co-authored-by: Lukiianchuk Dmitrii <d.lukiyanchuk@butik.ru> Co-authored-by: Marcin Romaszewicz <47459980+deepmap-marcinr@users.noreply.github.com>
…gen#306) Co-authored-by: Marcin Romaszewicz <47459980+deepmap-marcinr@users.noreply.github.com>
…codegen#313)" This reverts commit 720dae1. It broke path handling in a different way. We will fix this differently.
This fixes oapi-codegen#312, by ensuring that queries are properly escaped in the client, and properly unescaped in the server.
The client can have a per-request editor function, so add it to the ClientWithResponses for consistency.
This fixes oapi-codegen#316. Maps are randomized, so sort the keys.
Kin 0.48+ requires Go 1.16 because it uses the embed directive, so we can't use it.
kin-openapi requires Go 1.14, and therefore, so do we.
…en#322) Co-authored-by: Marcin Romaszewicz <47459980+deepmap-marcinr@users.noreply.github.com>
…pi-codegen#322)" This reverts commit 88f937a. The kin legacy routers force pulling in kin-openapi@0.52.0 which requires Go 1.16
This fixes oapi-codegen#302. We were really sloppy with escaping and unescaping parameters, so I added another parameter to Bind/StyleParam which informs where the parameter is located, so that we can do proper escaping based on location. The server code performs corresponding unescaping.
…nt. (oapi-codegen#331) * Change default client template to use new http.Client not DefaultClient. * Update generated client code among tests. * Update generated client code at example petstore-expanded. * Update generated client code at package codegen templates.
…gen#329) (oapi-codegen#330) * fix when responseBody has multiple media types * fix failing test
* add description field * use description field in template * fix tests * remove last line * Update templates.gen.go * Update templates.gen.go * remove hardcoded stuff * Update typedef.tmpl * simplify by adding description to Schema * Update components.gen.go * Update templates.gen.go * Update schema.go * fix tests * fix tests * Update schema.go * fix tests
I don't like how ClientWithResponses meta-info snuck into the very generic TypeDefinition, so create a struct called ResponseTypeDefinition which embeds TypeDefinition and adds extra fields. I eventually want to refactor this completely, and separating these two types will prevent them becoming more conjoined.
Co-authored-by: Weidong Feng <weidong.feng@shanbay.com> Co-authored-by: Marcin Romaszewicz <47459980+deepmap-marcinr@users.noreply.github.com>
* implemented openapi specification loading in runtime with external reference resolution * go generate ./... * test "GetSwagger" function using the example with external references
* fix(model): Copying servers from path definition to operation definition * feat(enums): Adding support for enums in all positions
Eliminate the generation of an empty body content type switch. Also: * Just declare a new buffer no need to call bytes.NewBufferString.
Fix the depth check in RefPathToGoType which was incorrectly resulting in an error when processing URL or Remote references. Also: * Leverage sub tests to add more tests to TestRefPathToGoType to cover all the different types of expected refs. * Fix the URL example in RefPathToGoType doc comment.
Remove the unneeded separating new line from the first field of a struct.
* Fix tests of oapi-codegen#312 to check real urls * Fix double escape of uri parameters
Tweak the body templates to remove the duplicate space from the "with any body" comments.
Fixes the net/http server generation example to use valid function parameters. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
* fix: fix panic when printing the nil Date Not sure why, but this is only happening when running with delve. It seems like printing a nil Stringer causes a panic when debugging with delve but is handled gracefully outside of delve. Steps to reproduce: 1. Start debugger 2. Print the value of a nil Date ```go var d *Date fmt.Sprintf("%v", d) ``` Theory: `time.Time` is embedded within the `Date` type. This means that if Date is nil and Stringer is used to get the string representation of it, it'll try to call Date.Time.String() which will result in a nil dereferencing error. * Regenerate code Co-authored-by: Beng Lim <beng.lim@outlook.com>
replacing: `oapi-generate` with: `oapi-codegen`
* remove github.com/pkg/errors * `go mod tidy` * fix losted err wrap
…gen#427) Co-authored-by: kotyara85 <konrasko@gmail.com> Co-authored-by: Marcin Romaszewicz <47459980+deepmap-marcinr@users.noreply.github.com>
My manual conflict merge created problems, regenerate the affected file.
* fix: client response template to ignore errors Presently rsp.Body.Close masks away the error without checking for them. This code will do the same but give linters the assumption that it alteast considering to look at them. * Ran all commands in travisCI.yaml
This fixes a merge issue from a PR which didn't include some new changes.
This change creates a little program which shows how to perform JWT validation.
…en#459) * oapi-codegen#367 error handler callback * removing logs * refactoring, checking if function is declared and using default otherwise
* fix for ci * update readme * feat: add gin server support * save work * save work * save work * save work * save work * save work * tidy mod * update ci * add gin mw * bump go version to 1.16 Co-authored-by: Marcin Romaszewicz <47459980+deepmap-marcinr@users.noreply.github.com>
…sing a path (oapi-codegen#474) Co-authored-by: Marcin Romaszewicz <47459980+deepmap-marcinr@users.noreply.github.com>
LGTM |
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.
改动:
BREAKING CHANGE:
oapi-codegen
命令需要是-generate=types,nested-types,client,server,spec,skip-prune
参数,带上 nested-types 才会去嵌套生成匿名 structAudioAddressApp_ALL
现在是AudioAddressAppALL