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 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
@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",
Copy link
Member

@bobdenotter bobdenotter Apr 19, 2019

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?

Loading

Copy link
Member Author

@JarJak JarJak Apr 19, 2019

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 ;)

Loading

@JarJak
Copy link
Member Author

@JarJak 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?

Loading

@bobdenotter
Copy link
Member

@bobdenotter bobdenotter 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. :-)

Loading

@JarJak
Copy link
Member Author

@JarJak JarJak commented Apr 19, 2019

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

Loading

@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
Loading
@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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants