fix: fixed schema alias template to really generate type aliases#1490
Open
bit0rez wants to merge 1 commit intoogen-go:mainfrom
Open
fix: fixed schema alias template to really generate type aliases#1490bit0rez wants to merge 1 commit intoogen-go:mainfrom
bit0rez wants to merge 1 commit intoogen-go:mainfrom
Conversation
Contributor
|
What if the alias has different validation or defaults? Making it an actual go type alias would break this. |
Author
I'll rollback this for non struct types. For structs with embedding it works fine. |
928a6ca to
18d14ea
Compare
Author
|
UP! |
816dcb3 to
7abcb48
Compare
Member
|
This breaks tests: ernado@nexus:/src/ogen/ogen$ make test
# github.com/ogen-go/ogen/internal/integration/test_http_requests
internal/integration/test_http_requests/oas_request_decoders_gen.go:165:60: cannot convert unwrapped (variable of struct type SimpleObject) to type AllRequestBodiesApplicationXWwwFormUrlencoded
internal/integration/test_http_requests/oas_request_decoders_gen.go:401:68: cannot convert unwrapped (variable of struct type SimpleObject) to type AllRequestBodiesOptionalApplicationXWwwFormUrlencodedPlease iterate with |
7abcb48 to
d125e78
Compare
3b2ce3a to
afa85d2
Compare
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
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.
Problem code example
So, client can't use interface for this types and access SomeField in some cases.
Just generate real go type alias and embed structures to fixing this problem.