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

feat: Add JSON tags to SDK structs so it's easier to know how the resulting JSON would look like #23882

Open
erezrokah opened this issue Dec 19, 2024 · 1 comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@erezrokah
Copy link
Contributor

Feature Request

Somehow related to #19356 from a another angle.

Since the Azure SDK uses custom JSON marshalling without json tags it's hard to know the resulting json structure statically.
Example in

func (v VirtualMachine) MarshalJSON() ([]byte, error) {

Image

Image

For context, using the standard library JSON encoding will use the original field names.

Is this something you're willing to consider? Not sure how the code gen is done, but if you're open to it I can take a look at adding it.

The use case is statically generating a JSON schema for the models, so it can later be used to validate access to the JSON data (e.g. catch a typo in a field).

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 19, 2024
@tadelesh tadelesh added the feature-request This issue requires a new behavior in the product in order be resolved. label Dec 23, 2024
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 23, 2024
@tadelesh
Copy link
Member

tadelesh commented Jan 7, 2025

@jhendrixMSFT could you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

2 participants