Skip to content

add $key for all object and support private class name #32

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thesadboy
Copy link
Contributor

As the readme file shows, add $key for all object, not only in array. The $key value support private ClassName start by _ .

@etoiledemer
Copy link

i like that 👍

@etoiledemer
Copy link

@mark-apn can we merge this?

@mark-nicepants
Copy link
Collaborator

Sorry for keeping you waiting. I'll take a look at this this week!

@mark-nicepants
Copy link
Collaborator

Question about this PR.

Why not just change the key in the json in the first place.

{
   "movie": {
      "id": 123
   }
}

Will generate a Movie class and by changing the key movie you change the key in the output.

Why do we need this:

{
   "movie": {
      "$key":  "film",
      "id": 123,
   }
}

When we can just do this.

{
   "film": {
      "id": 123
   }
}

@etoiledemer
Copy link

etoiledemer commented Jun 8, 2022

if I remember correctly it helps fixing this : #30
without having to use separate files;

(when we have two keys with same name, but with different properties, it avoid name clashes in generated files)

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

Successfully merging this pull request may close these issues.

3 participants