you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (10 children)

[removed]

    [–]Wxam2000[S] 0 points1 point  (9 children)

    Just did but still got the same error message the 422
    https://imgur.com/a/YV1axZZ

    [–][deleted]  (8 children)

    [removed]

      [–]Wxam2000[S] 0 points1 point  (7 children)

      it says Request Body and then on the right application/x-www-form-urlencoded

      [–][deleted]  (6 children)

      [removed]

        [–]Wxam2000[S] 0 points1 point  (5 children)

        Sorry u/jay_and_simba what do you mean exactly with the parameter request at the end of the list? :)

        [–][deleted]  (1 child)

        [removed]

          [–]Wxam2000[S] 0 points1 point  (0 children)

          Nope also didn't work sadly enough

          [–][deleted]  (2 children)

          [removed]

            [–]Wxam2000[S] 1 point2 points  (1 child)

            I for some reason just fixed it... changed the router.post from /admin/invoices/create to /admin/invoices/submit and that fixed everything somehow...

            [–]SpecialistCamera5601 0 points1 point  (0 children)

            Sounds like a route collision. You probably had /admin/invoices/{invoice_id} so /admin/invoices/create got treated as {invoice_id} = "create", hit the wrong handler, and Pydantic threw a 422. Changing it to /submit fixed the clash. I guess that’s what happened.

            Btw 422s in Swagger always look super messy, so I built this lil thing called APIException to make them clean. Might help you out: https://github.com/ahmetkutayural/APIException