Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jpwijbenga opened this issue Jun 24, 2024 · 3 comments
Open

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

jpwijbenga opened this issue Jun 24, 2024 · 3 comments

Comments

@jpwijbenga
Copy link

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
Copy link
Author

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

@jpwijbenga
Copy link
Author

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

@ArrayIterator
Copy link

ArrayIterator commented Sep 19, 2024

Any info?

I also just try to manually set to $ownerSchema->{'$id'} and this is so weird.

foreach ($properties->getDataKeyMap() as $propertyName => $dataName) {

image

I found that, even we've already set key data mapping :

$ownerSchema->addPropertyMapping(Schema::PROP_ID, 'id');

On json serialize wil use id rather than setted data mapping, because the previous key data mapped has been ignored or not substitute with current data key set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants