swaggest / php-json-schema

High definition PHP structures with JSON-schema based validation
MIT License
438 stars 50 forks source link

Cant get exporter to set `$id` instead of `id` for schema id. #161

Open jpwijbenga opened 2 months ago

jpwijbenga commented 2 months ago

I'm trying to export a given schema to generate draft 7, which means use '$id' instead of 'id'. Trying with context passed to exporter, but it will keep generating id not $id.

image

Bug or am I doing it wrong?

jpwijbenga commented 2 months ago

So the picture I posted is the fix because it doesn't work without third ande fourth line.

jpwijbenga commented 2 months ago

Also, I looked through readme and tests, but couldn't find anything about setting version wrt. export.