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

Fields API #406

Merged
merged 3 commits into from
Apr 19, 2019
Merged

Fields API #406

merged 3 commits into from
Apr 19, 2019

Conversation

JarJak
Copy link
Member

@JarJak JarJak commented Apr 18, 2019

As an addition to #150 I've added API endpoints for fields, so now you can make a request like
GET /api/contents/1/fields.json
and it will return all names and values fields of this content. Values are always arrays here, like:

[
  {
    "name": "Title",
    "value: [
      "Hello world!"
    ]
  }
]

TBD: I can also add type of field to it in case someone will find it is useful information in frontend for proper rendering.

@JarJak JarJak force-pushed the feature/fields-api branch 6 times, most recently from 06df38a to 1b81fac Compare April 18, 2019 22:24
@@ -66,7 +66,7 @@
"behat/mink-extension": "^2.3",
"behat/mink-goutte-driver": "^1.2",
"behatch/contexts": "^3.2",
"coduo/php-matcher": "^3.1.2",
"coduo/php-matcher": "dev-patch-2@dev",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocking issue, but is this coduo/php-matcher robust? I think this is the second or third time we've had to use it as non-stable, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I've made another PR to them ;)

@JarJak
Copy link
Member Author

JarJak commented Apr 19, 2019

TBD: I can also add type of field to it in case someone will find it is useful information in frontend for proper rendering.

@bobdenotter wdyt? would it be useful for headless frontend?

@bobdenotter
Copy link
Member

wdyt? would it be useful for headless frontend?

Yes, very much! it'll be great for context. If something has a value of foo, and it comes from a type: text you might want to display it differently than something that's a type: select. :-)

@JarJak
Copy link
Member Author

JarJak commented Apr 19, 2019

@bobdenotter field type added in API response. Also I've made Dynamic DiscriminatorMap :D

@JarJak JarJak merged commit 75bd2ba into master Apr 19, 2019
@JarJak JarJak deleted the feature/fields-api branch April 19, 2019 13:29
@bobdenotter bobdenotter added this to the Bolt 4 beta 1 milestone Apr 19, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants