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

Support for object and not only array of objects #57

Open
barning opened this issue Dec 12, 2022 · 5 comments
Open

Support for object and not only array of objects #57

barning opened this issue Dec 12, 2022 · 5 comments

Comments

@barning
Copy link

barning commented Dec 12, 2022

Hey, would it be possible to also support this kind of json?

{
  "name": "John Doe",
  "age": 32,
  "is_admin": true,
  "skills": ["JavaScript", "HTML", "CSS"]
}

My workaround right now is to put the object into an array. Some APIs simply don't return an array of objects and this change would be really helpful.

@jausto
Copy link

jausto commented Dec 22, 2022

bump!

@PavelLaptev
Copy link
Owner

@barning your example is just one object. You can't fill multiple things with it. Can you provide another example? How it would look like?

Like this?

{
  "user1": {
    ...data
  },
  {
  "user2": {
    ...data
  }
}

@barning
Copy link
Author

barning commented Jan 15, 2023

Yes, it would look like this.

@PavelLaptev
Copy link
Owner

@barning @jausto can you add here a few real samples I can work with? Don't need to share whole files, but real example will be helpful.

@barning
Copy link
Author

barning commented Mar 21, 2023

@PavelLaptev I cannot share real examples but this comes pretty close.

{
  "id": 1231511,
  "urn": "urn",
  "tag": "tag",
  "boolean": true,
  "name": "Name",
  "keywords": null,
  "zip_code": "*",
  "city": "*",
  "country": "de",
  "visible": true,
  "public": true,
  "array": [
    "1",
    "2",
    "3"
  ],
  "another_array": [
    "1",
    "2",
    "3"
  ],
  "another_boolean": true
}

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

No branches or pull requests

3 participants