JSON Schema required ID in case of creating ResourceObject

I have a question about json-schema, currently file: /schema in repo. There is condition that {type, id} pair is always required. But I got to situation when I legitly cannot provide ID, in case when I POSTing new Resource. I want use json-schema to validation for request data, but schema unconditionally require ID. But in spec ID is not neccessary required if creating new resource https://jsonapi.org/format/#crud-creating. I think this is bug, but maybe I’m using schema validation in bad case. So my question is: is it bug or I’m just using it wrong?

Hi!

The JSON Schema file is just about response bodies, not about request bodies. It is not a bug in the schema and your assumption, that when creating you don’t have to send the id, is correct.

1 Like