ssossossossosso

Forums

Forums OroPlatform OroPlatform – Programming Questions Error using POST RestAPI

This topic contains 2 replies, has 2 voices, and was last updated by  Rodolfo 2 years, 7 months ago.

  • Creator
    Topic
  • #28392

    Rodolfo
    Participant

    Hello!

    I’m stuck on this is the error:

    {“code”:400,”message”:”Validation Failed”,”errors”:{“errors”:[“This form should not contain extra fields.”],”children”:{“owner”:[]}}}string(156) “Client error response [url] http://acme.dev/api/rest/latest/physicalstore/accounts.json [status code] 400 [reason phrase] Bad Request”
    string(0) “”

    This is my client using GuzzleHttp and I’m passing only the required fields:

    I created this POST using the field structure that I’m receiving when I call CGET method. Even having a Owner and Organization id on the database table, Rest are returning empty values.. I’m not sure why..

    Do you guys have any idea what’s wrong?

    This is some pieces of my Entity Class:

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #28393

    Vova Soroka
    Participant

    Hello Rodolfo!

    To see the list of invalid extra fields you can change extra_fields_message option for your form. For example:

    #28394

    Rodolfo
    Participant

    Hello @vova_soroka,

    Thanks for your help. The problem here was that I forgot to create a parent FormType and add all the fields on buildForm method. I also had to extend it on my FormApiType. I’ll leave some commands here that helped me to debug and find the problem.

    In my xxxxApiHandler process() method:

    Thank you so much!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.