-
Notifications
You must be signed in to change notification settings - Fork 14
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
Upgrading oapi library #107
Conversation
cc @IfSentient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Thanks for all your work on this, i know it's been quite a journey 😅
@@ -4,7 +4,7 @@ package generate | |||
import "github.com/grafana/thema" | |||
|
|||
thema.#Lineage | |||
name: "pointers" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uuuuggghhh there's still a bug in the txtar framework i wrote - something is leaking across goroutines and causing flipping in the expected name used for lineages.
return is | ||
} | ||
|
||
// It fixes the "generic" fields. It happens when a value in cue could be different structs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// It fixes the "generic" fields. It happens when a value in cue could be different structs. | |
// fixRawData fixes "generic" fields. It happens when a value in cue could be different structs. |
Important: The library introduced a bug checking pointers equality and some cue files fail. I created a PR in their repo to fix that. If they don't respond in time, we can use my fork to make it work.
It upgrades oapi library to
v1.12.4
. I'm going to try to clarify the changes...The oapi library introduce these changes:
some
comments: It means that it set the name of each field/struct at the beginning of each comment. That's "correct" because it makes GoLint happy but it breaks most of our comments. It works different when is group or not 🤷🏻♀️.*interface{}
that it did the work."AdditionalProperties"
to fix them.*interface{}
became structs that its ok.Changes that I added:
decoderCompactor()
isn't necessary anymore.UseGoDeclInComments
to allow default configuration in comments. By default it leaves the comments "as" we put in the cue file. Its not perfect but its accurate 😞.*interface{}
and leave them as this. Also deletes the related functions and models affected.Pending stuff:
"Generic" structs
When I was talking about generic structs I mean the ones that accept multiple values like:
It was generating the following:
and used like:
And after all changes, we are going to have the previous behaviour: