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

Conversation

@JarJak
Copy link
Member

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 requested review from bobdenotter and nestordedios Apr 18, 2019

@JarJak JarJak force-pushed the feature/fields-api branch 6 times, most recently from 06df38a to 1b81fac Apr 18, 2019

Jarek Jakubowski

@JarJak JarJak force-pushed the feature/fields-api branch from 1b81fac to 67d7371 Apr 18, 2019

@@ -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",

This comment has been minimized.

Copy link
@bobdenotter

bobdenotter Apr 19, 2019

Member

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?

This comment has been minimized.

Copy link
@JarJak

JarJak Apr 19, 2019

Author Member

Because I've made another PR to them ;)

@JarJak

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

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

This comment has been minimized.

Copy link
Member Author

commented Apr 19, 2019

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

Jarek Jakubowski

@JarJak JarJak force-pushed the feature/fields-api branch from f02cefc to bbc6e47 Apr 19, 2019

@JarJak JarJak merged commit 75bd2ba into master Apr 19, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@JarJak JarJak deleted the feature/fields-api branch Apr 19, 2019

@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
Projects
None yet
2 participants
You can’t perform that action at this time.