robocode-dev / tank-royale

Git repository for Robocode Tank Royale
Apache License 2.0
122 stars 23 forks source link

json $type field problematic with python code generation #31

Closed stobias123 closed 2 years ago

stobias123 commented 2 years ago

Describe the bug I'm trying to generate some python clients from the given json schema. I'm using https://github.com/koxudaxi/datamodel-code-generator/ , and the $type field is giving me lots of grief.

Since python can't use special chars in var/param names, I'm wondering if there's some reason this field needs to have a $?

Error info All sorts, there's no easy code gen from existing json schema tooling.

flemming-n-larsen commented 2 years ago

That is a good point Steven. 👍 The $type should not get in the way when using it with other programming languages and parsers. So I will see if I can fix this to a better name without a special character in front of "type".

flemming-n-larsen commented 2 years ago

@stobias123, I have changed $type into type on the master branch. I hope this works better for you?

stobias123 commented 2 years ago

@flemming-n-larsen - yes perfect thank you! I was running a local fork over the weekend with that same change.

flemming-n-larsen commented 2 years ago

@flemming-n-larsen - yes perfect thank you! I was running a local fork over the weekend with that same change.

Cool. Then we are sure it will work. Thank you for reporting this issue, so we could get it fixed. 🙂