nmfta-repo / nmfta-opentelematics-api

API Blueprint for Open Telematics API
Apache License 2.0
14 stars 6 forks source link

place size and content limits on the schema #23

Closed BenGardiner closed 5 years ago

BenGardiner commented 5 years ago

Not a huge impact while this is a read-only API -- low priority

BenGardiner commented 5 years ago

this matters now that we have inbound data.

the objects in the Open Telematics TSP Inbound Objects (object) section of apiary.apib need to be refined to strictly limit the size, type and content of these objects

BenGardiner commented 5 years ago

The only way to specify validation rules (including field size limits) in API Blueprint is by attaching custom JSON schema. This results in a fragile spec since the Attributes can get out of sync with Schema.

I'm checking with apimatic if auto-generated SDKs will honor JSON schemas attached to responses and if the client code will enforce validation before further processing. If yes, then it may be worth add ~80 JSON schemas to the responses in the current spec.

BenGardiner commented 5 years ago

Apimatic has confirmed that the generated client SDKs perform no input validation based on the JSON schemas of the API specification.

Therefore, there is no clear advantage to adding JSON schemas over the MSON attributes and then augmenting the JSON schemas with size restrictions.