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

Using Visual Studio for C#, Paste special, Paste JSON as classes, Lists and attributes with dots. #2031

Open
scampsd opened this issue Jun 11, 2021 · 0 comments

Comments

@scampsd
Copy link

scampsd commented Jun 11, 2021

I've just installed Web Essentials for making a class diagram for a JSON structure. I've copied the JSON structure, and used the Visual Studio Paste Special "Paste JSON as classes" feature.

This worked almost fine, but there were two issues:
My JSON contained attributes with dots. Those were deleted, but no [JsonProperty] was created for it.
My JSON contained collections. Web Essentials used dynamical arrays for those, while List objects are to be preferred (in case one needs to increase).

JSON excerpt:

	"header.rest_of_attribute": 10000,
	"tags": [
	...
	]

Web Essentials generated this:

        public int headerrest_of_attribute { get; set; }
        public Tag[] tags { get; set; }

What Web Essentials should generate:

        [JsonProperty("header.rest_of_attribute")]
		public int headerrest_of_attribute { get; set; }
        public List<Tag> tags { get; set; }

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant