Skip to content

Extend usage of name converter #78

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

Closed
jderusse opened this issue May 25, 2015 · 5 comments
Closed

Extend usage of name converter #78

jderusse opened this issue May 25, 2015 · 5 comments
Milestone

Comments

@jderusse
Copy link
Contributor

Actualy name converter is used in (de)normalization of the object.
But it should also be used in several locations:

  • In violation's propertyPath
"violations": [
        {
            "message": "This value should not be blank.", 
            "propertyPath": "content" <== here
        }
    ]
  • In filters => http://localhost:8000/api/offers?price=10 price should be denormalized
  • or in /offers?order[name]=desc&order[id]=asc.
@dunglas
Copy link
Member

dunglas commented May 25, 2015

Also in EntrypointBuilder and in ApiDocumentationBuilder.

@Simperfit
Copy link
Contributor

What is this about ? Is it still relevant ?

@dunglas
Copy link
Member

dunglas commented Oct 2, 2016

It has been partially fixed by @meyerbaptiste in #770 but I think there are still some places to cover like property paths and filters.

@aistis-
Copy link

aistis- commented Feb 10, 2017

The issue still persist in v2.0.3

I use config:

api_platform:
    name_converter: 'serializer.name_converter.camel_case_to_snake_case'

An example of returned 400 response:

{
	"type": "https://tools.ietf.org/html/rfc2616#section-10",
	"title": "An error occurred",
	"detail": "categoryId: This value should not be blank. supplierId: This value should not be blank. value: This value should not be blank.",
	"violations":
	[
		{
			"propertyPath": "categoryId",
			"message": "This value should not be blank."
		},
		{
			"propertyPath": "supplierId",
			"message": "This value should not be blank."
		},
		{
			"propertyPath": "value",
			"message": "This value should not be blank."
		}
	],
}

Neither propertyPath nor categoryId/supplierId is run over name converter.

@Simperfit
Copy link
Contributor

This has been fixed by @meyerbaptiste

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

4 participants