Cant Resolve Reference from Schema

Hi,
I am having an issue referenceing a schema inside another.
I have an entity ‘Orders’, and in that entity I have a paramater called ‘Orderdetails’ which is an array of OrderDetail objects.
I have successfully created the Schema for both entities, and they validate correctly on API responses.

When I go to the Order schema and create a new parameter for OrderDetails, I give it the type of ‘Array’ and the items inside the array as linked Schema ‘OrderDetails’. This works and looks fine in the Schema view, it pulls all the correct properties through into the array object.

However now when I try to validate the Order schema against the API response, it gives this error:
‘can’t resolve reference #/definitions/3133027 from id http://json-schema.org/draft-04/Order’.

If I go back to the Order schema, and dereference the orderdetail schema, it validates fine. As soon as there is a link between the Order and OrderDetails schemas, I always get that error message.

Any help in correctly validating this linked schema is greatly appreciated. Thankyou very much.
Screenshot_2024-08-30_121154.jpg
Screenshot_2024-08-30_121140.jpg
Screenshot_2024-08-30_121107.jpg

Hi, can you present the entire screenshots of the schema ‘Orders’ and ‘OrderDetails’ ?

Hi,
Thanks for the reply. Requested screenshots are attached.




It seems the JSON Schema for the Order includes the field “$id”: “Order”. Please remove this field and try again. We may directly ignore this field in the future to avoid such issues.


Hi,
Removing this ID field has solved the problem, thanks very much :slightly_smiling_face:
I must add that I did manually mess with this field after creating the schema directly from my db, so it is probably me who made this error happen.
Thanks again