3
votes
What is the purpose of adding a schema validation in responses?
I used to do this with XML back in the day. The idea is that you give your clients a schema and you should guarantee that you follow it, otherwise you might cause an error.
I agree with you though, ...
2
votes
Content Types of JSON in particular schema
You might be able to use content-type parameters as in
application/json; schema=foo
application/json; schema=bar
I don't know whether adding user-defined parameters is officially blessed, but as long ...
2
votes
Is JSON Schema-based runtime validation more practical than static type hints in real-world Python applications?
From the comments on the question:
[amon] Use Pydantic. Get static typing and JSON Schema validation.
[agolta] Given that both serve the same purpose, using JSON Schema appears to be the more ...
2
votes
Accepted
Where should schemas be maintained?
This looks like something a good old version control system such as git could handle well.
The stuff that you're versioning is basically textual in nature, and git etc. handle evolving texts pretty ...
2
votes
Correct way to return JSON schemas in a REST API
It is not clear for me if you are at the client side or backend side,
but what you have mentioned so far is that you are moving to more Contract-First approach, which is common in SOAP, but what you ...
1
vote
Content Negotiation: Is a meta representation of a resource, like a JSON Schema, an appropriate REST representation?
I think that this is a cool idea to the extent of it's intended purpose. That being said, I DO NOT think that it would be appropriate by any means to attach it to the GET /student/{id} endpoint. The ...
1
vote
Is JSON Schema-based runtime validation more practical than static type hints in real-world Python applications?
Let's start with the most important observation: static analysis is almost always superior to runtime checks. Because it allows you to catch errors before the actual code runs, before it is deployed. ...
1
vote
Is JSON Schema-based runtime validation more practical than static type hints in real-world Python applications?
deeply nested dict/JSON structures
This is your problem, or at least why type hints aren't working for you. If you want Python's type hinting to work for you, don't have deeply nested dict-equivalent ...
1
vote
Accepted
Correct way to return JSON schemas in a REST API
I have seen some people suggesting creating an endpoint called /schemas/
Most of the validation schemes out there are public, hence, have a route. So yes, you need to make it public. It doesn't mean ...
1
vote
How to model JSON data so it can be easily de-serialized in to simple Java classes?
I think your question may have been answered over at Stack Overflow. It involves using the http://json-schema.org/ spec for designing your JSON and converting it with https://github.com/joelittlejohn/...
1
vote
Accepted
How to model JSON data so it can be easily de-serialized in to simple Java classes?
When object serialization is involved a Data Transfer Object (as you mentioned) gives you the flexibility you need to mirror the JSON structure in an object oriented language. Each tech stack has a ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
json-schema × 8json × 3
rest × 2
java × 1
database-design × 1
api-design × 1
microservices × 1
data-structures × 1
coding-standards × 1
validation × 1
xml × 1
nosql × 1
search × 1
postgres × 1
dynamic-typing × 1
schema × 1
static-typing × 1