django-ninja icon indicating copy to clipboard operation
django-ninja copied to clipboard

respect the 'by_alias' route config also in generated docs for 'json body' data

Open kristian-lindin opened this issue 1 year ago • 8 comments

if you have an alias_generator to_camel, the current behavior does not respect the by_alias config from the router when it comes to request body data and how the api documentation then is generated for that request body. Today the code that generates the request body docs, defaults to True without ever passing the operation.by_alias into the function. This PR should correct that.

kristian-lindin avatar Jun 14 '24 18:06 kristian-lindin

Hi @kristian-lindin

Thank you for PR - could you also make a test case that covers this ?

vitalik avatar Jun 26 '24 07:06 vitalik

I have added tests for it now. Feel free to check it out. I think the CI should succeed.

On another note: It seems like the "make lint" uses a ruff formatting that is incompatible with the formatting check on the CI.

kristian-lindin avatar Jul 17 '24 13:07 kristian-lindin

Hey @kristian-lindin this was super helpful for a similar issue I was facing, thanks!

@vitalik is there anything else this needs before it's ready to merge? Happy to assist if so.

jboutros avatar Aug 29 '24 02:08 jboutros

@vitalik Please let me know if there is anything else I can do to move this PR forward.

kristian-lindin avatar Oct 02 '24 20:10 kristian-lindin

@vitalik As mentioned, I feel like this PR should be ready. Let me know if I can do anything to get this PR to move forward or help in any way!

kristian-lindin avatar Oct 29 '24 14:10 kristian-lindin

@vitalik Once again. Please let me know if I can assist in anyway to move this PR forward 🙏!

kristian-lindin avatar Jan 15 '25 21:01 kristian-lindin

Agreed, this would be super helpful to have merged in! Thank you all

jboutros avatar Jan 16 '25 00:01 jboutros

@vitalik I'll try another ping to try to move this PR forward. Its been pending for 9 months without and kind of response. As mentioned, Im happy to help in anyway I can, just say the word ❤️ !

kristian-lindin avatar Mar 15 '25 22:03 kristian-lindin