Open ygoe opened 5 months ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
What does "JsonPropertyNameAttribute" do in that text?
What text? You appear to refer to some documentation page, but you failed to mention which page you are referring to.
And where is the documentation for this JsonPropertyOrderAttribute after all?
Where all the documentation of all the types of the .NET BCL can be found, at https://learn.microsoft.com/en-us/dotnet/api, specifically https://learn.microsoft.com/en-us/dotnet/api/system.text.json.serialization.jsonpropertyorderattribute
Something must have gone wrong here. I clicked on the feedback link at the bottom of the page and usually this will be linked with the page I reported it from.
Meanwhile I found third-party information from others who have done some reverse-engineering. The default order value for all properties seems to be 0, also if unset. So to bring single properties to the top, they need to have negative numbers. This could have been mentioned somewhere with the documentation of that attribute.
This could have been mentioned somewhere with the documentation of that attribute.
It is mentioned in the attribute's documentation. Look at the documentation i linked to in my previous comment (https://learn.microsoft.com/en-us/dotnet/api/system.text.json.serialization.jsonpropertyorderattribute), it says the following:
Specifies the property order that is present in the JSON when serializing. Lower values are serialized first. If the attribute is not specified, the default value is 0.
That said, i tend to agree that it would help to place this information also on the constructor's documentation page, because it is specifically about the constructor's order parameter.
Tagging subscribers to this area: @dotnet/area-system-text-json
That said, i tend to agree that it would help to place this information also on the constructor's documentation page, because it is specifically about the constructor's order parameter.
It's not something that we usually do for parameters if the corresponding concept is already documented on the type level. That being said, happy to review a PR that improves things.
What does "JsonPropertyNameAttribute" do in that text?
And where is the documentation for this JsonPropertyOrderAttribute after all? I can't find it on that page. The text just states obvious things but with no word explains how to use this attribute.
.NET documentation isn't anymore what it used to be. Lots of gaps and missing explanations now.