Closed svacas closed 8 years ago
As for me validating request body is actually not related to media type. But according to matching rules I think we should use sub type from https://en.wikipedia.org/wiki/Media_type and check if it xml
or json
(this only restriction that comes to my mind is that you can not use xsd schema with json related media types and vice versa)
Any client tool like the RAML Console needs to know this rules in order to present valid examples for requests and responses. Otherwise the examples are useless.
@svacas the question is if you agree to what Pavel said?
I'm OK with it as long as it's clear in the spec
So @petrochenko-pavel-a is it enough to mention the matching rules that @svacas highlighted and that a RAML processor MUST validate a request body against these?
OK, thinking about that with a couple of people - it would be better to keep that not mandated by the specification. Every implementor should decide what media types their tooling supports and clearly state it. The specification should be free from that giving the needed flexibility. @svacas do you agree?
Agreed
I'm not sure if the spec is clear in this respect, so here's a short list of possible rules to match media types to body schema validation formats:
JSON matching rules
XML matching rules