Skip to content
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

Handle additional property formats #2503

Open
theunrepentantgeek opened this issue Sep 18, 2022 · 8 comments
Open

Handle additional property formats #2503

theunrepentantgeek opened this issue Sep 18, 2022 · 8 comments
Labels
good-first-issue issues which would be a good starting point for newcomers to the codebase

Comments

@theunrepentantgeek
Copy link
Member

Describe the current behavior

During run of the code generator, we get warnings about unsupported property formats:

W0919 10:16:53.861756   37696 jsonast.go:339] unknown format "base64url"
W0919 10:16:53.908731   37696 jsonast.go:339] unknown format "uri"
W0919 10:17:24.732709   37696 jsonast.go:339] unknown format "byte"

Describe the improvement

We should add proper support for these formats so that our CRDs properly validate up front.

Additional context

This may technically be a breaking change, as we'll be rejecting values previously accepted - but given they would then be rejected by ARM, I don't think this will negatively impact any current users.

@matthchr matthchr added this to the v2.0.0-beta.3 milestone Sep 19, 2022
@matthchr matthchr added the good-first-issue issues which would be a good starting point for newcomers to the codebase label Sep 19, 2022
@matthchr matthchr modified the milestones: v2.0.0-beta.3, v2.0.0-beta.5 Oct 24, 2022
@PawelHaracz
Copy link

@matthchr can I take it and do it? should I know something more about these fields?

@theunrepentantgeek
Copy link
Member Author

You're welcome to take this issue and do it.

We already handle a bunch of formats - typically, a format gets translated into an underlying type (e.g. IntType) and some validation rules. For example, byte probably becomes IntType + Min: 0 + Max: 255

@PawelHaracz
Copy link

@theunrepentantgeek can you help me and tell me where or how I can generate a config file for the code generator? or can you attach some an example?

@theunrepentantgeek
Copy link
Member Author

Apologies @PawelHaracz, somehow I missed your message. 😢

If you're still interested (no problem if you're not), I'd suggest reusing the existing configuration file for the generator - v2/azure-arm.yaml. The commandline to run the generator would look like this:

$ generator gen-types azure-arm.yaml

When the data format is handled, you should see a few small changes in the generated code under v2/api.

@PawelHaracz
Copy link

Thank you for your respons. Of course, I want to still try to help you. I gonna try to use this clip and resolve the issue 😃

@matthchr
Copy link
Member

We're still interested in doing this, although to date we haven't seen many issues with lack of this support.

@theunrepentantgeek theunrepentantgeek modified the milestones: v2.6.0, v2.7.0 Dec 11, 2023
@matthchr matthchr removed this from the v2.7.0 milestone Feb 22, 2024
@matthchr
Copy link
Member

No change from above.

@theunrepentantgeek
Copy link
Member Author

theunrepentantgeek commented Sep 30, 2024

We still want this. The code has moved to line 270.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue issues which would be a good starting point for newcomers to the codebase
Projects
Development

No branches or pull requests

3 participants