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

Use Swagger as a single source of truth #1758

Closed
matthchr opened this issue Aug 27, 2021 · 1 comment
Closed

Use Swagger as a single source of truth #1758

matthchr opened this issue Aug 27, 2021 · 1 comment
Assignees
Labels
high-priority Issues we intend to prioritize (security, outage, blocking bug)
Milestone

Comments

@matthchr
Copy link
Member

Describe the current behavior
We use both the Swagger and ARM JSON schemas as the source of truth for our types. This has some problems:

  1. The ARM JSON schema isn't entirely autogenerated, which means that there are sometimes manual mistakes.
  2. At the same time, it's mostly autogenerated from the Swagger, which means its source of truth and is really the Swagger. In places where it's not autogenerated from the Swagger they're actively trying to fix that.
  3. The generator has some issues, for example not excluding properties that are entirely readonly that we end up having to work around.

We also have to read the Swagger in order to generate the Status types, so we're already doing the work to parse it as well. We end up spending some effort trying to reconcile the two views of the world by effectively guessing at/understanding what the ARM JSON schema generator has done. Some examples of this are _childResource shenannigans and how they deal with resourceBase (see #1730)

Describe the improvement
Use only the Swagger as the source of truth. We can refer to for example the bicep type generator which does exactly this already. It's also worth noting that even the ARM team didn't use the ARM JSON schemas to generate the bicep types, they used the Swagger.

This would be a big change though.

@matthchr matthchr added the task label Aug 27, 2021
@Porges Porges self-assigned this Oct 7, 2021
@theunrepentantgeek theunrepentantgeek added this to the codegen-beta-0 milestone Feb 2, 2022
@matthchr matthchr changed the title Consider using Swagger as a single source of truth Use Swagger as a single source of truth Sep 27, 2022
@matthchr matthchr added the high-priority Issues we intend to prioritize (security, outage, blocking bug) label Sep 27, 2022
@matthchr matthchr modified the milestones: v2.0.0-beta.3, v2.0.0 beta.4 Oct 24, 2022
@theunrepentantgeek
Copy link
Member

Revolved by #2323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high-priority Issues we intend to prioritize (security, outage, blocking bug)
Projects
Development

No branches or pull requests

3 participants