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.
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
Support +mapType, +structType markers #178
Support +mapType, +structType markers #178
Changes from 1 commit
23431b4
7c6c06e
a0384dd
e01d666
8230c67
d17e71d
b567921
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Are these types supposed to generate something in some golden data? I don't see a corresponding update to some golden data
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.
Hm, good point. Not sure. The steps in the integration tests README don't change the golden data. The only thing that edits
golden.v2.json
is thebuilder
script 🤔 I'll dig into it a bit as I don't know this codebase that well - let me know if it's something obvious I'm missing!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.
I'm specifically concerned since the tests don't pass for me but they pass for the CI ...
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.
OK I can reproduce the failure on this pull-request while having master work.
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.
wait no it passes now ...
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.
Ahah it's absolutely terrible. You have to add your objects to:
https://github.com/kubernetes/kube-openapi/blob/master/test/integration/builder/main.go#L105-L117
We should have a way to fail if this is not done somehow ...
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.
Thanks! Added them with a0384dd - though if I'm honest I only partially understand what they're testing 🤔
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.
The test generates the openapi corresponding to the types that you have. Now we can look at the
report.v2.json
and see that it generates what we expect from the tags.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.
is this in the right place? the structType is annotating a string. Should it fail some sort of validation?
(and same problem above on the
AtomicStruct
)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.
Yeah, the annotation is applied to the string; "correctly" (in that
Field
gets the right tag in the produced API spec) but it's super confusing the way I've written it. I've changed it so that the marker annotates a "proper" struct - let me know what you think.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.
Indeed interesting that the validation didn't fail though when using
structType
on a string 🤔 I'll experiment with it and see if there's a problem here 🤔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.
Thanks for fixing this.