You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking at using JSON schema for our projects. One of the things that I see right off the is a poor modeling practice. Let me just jump to a nomenclature rule: Any object using a preface name more than once should be reviewed to be it's own object. The example in getting started is:
{
"productId": 1,
"productName": "A green door",
"price": 12.50,
"tags": [ "home", "green" ]
}
Where product is repeated. This should be represented like:
{"products":[
{"id":1, "name":"A green door", "price":12.50},
{"id":2, "name":"A white door", "price":14.00},
]}
Just a suggestion for beginners to see best practices.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am looking at using JSON schema for our projects. One of the things that I see right off the is a poor modeling practice. Let me just jump to a nomenclature rule: Any object using a preface name more than once should be reviewed to be it's own object. The example in getting started is:
{
"productId": 1,
"productName": "A green door",
"price": 12.50,
"tags": [ "home", "green" ]
}
Where product is repeated. This should be represented like:
{"products":[
{"id":1, "name":"A green door", "price":12.50},
{"id":2, "name":"A white door", "price":14.00},
]}
Just a suggestion for beginners to see best practices.
Beta Was this translation helpful? Give feedback.
All reactions