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

Fix a bug preventing to serialize validator's payload #3375

Merged
merged 2 commits into from
Apr 21, 2020

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Jan 31, 2020

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets n:a
License MIT
Doc PR n/a

The current behavior when dealing with validation error payload (severity etc) isn't in sync with what is expected and documented: https://api-platform.com/docs/core/validation/#error-levels-and-payload-serialization

This PR fixes this problem.

@dunglas dunglas force-pushed the fix-validator-payload branch from 5e7f0b0 to e5014d8 Compare January 31, 2020 17:29
Copy link
Member

@soyuka soyuka left a comment

Choose a reason for hiding this comment

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

lgtm can you rebase?

@teohhanhui
Copy link
Contributor

Hmm... I'm not familiar with this, but using an empty array to mean "all fields" is so confusing...

@teohhanhui
Copy link
Contributor

I think we should fix the documentation instead. null should mean all fields, and the empty array (used as default value) should mean none. WDYT @dunglas?

@dunglas
Copy link
Member Author

dunglas commented Apr 21, 2020

@teohhanhui you're right it's a better solution. Fixed.

@dunglas dunglas force-pushed the fix-validator-payload branch from 37a2787 to de6fb15 Compare April 21, 2020 10:36
@dunglas dunglas merged commit 5dd51a0 into api-platform:2.5 Apr 21, 2020
@dunglas dunglas deleted the fix-validator-payload branch April 21, 2020 12:20
dunglas added a commit that referenced this pull request Apr 21, 2020
* 2.5:
  Bump versions of Swagger UI, GraphiQL and GraphQL Playground and improve contrib instructions
  Update changelog
  Fix a bug preventing to serialize validator's payload (#3375)
  Ignore FOSUser deprecations only
  Fix tests (#3506)
  Stop suggestion FOSUser, it harms more than it helps
  Changelog for 2.5.5
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.

3 participants