jhthorsen / mojolicious-plugin-openapi

OpenAPI / Swagger plugin for Mojolicious
54 stars 44 forks source link

Fix for defaults in v3 #123

Closed plk closed 5 years ago

plk commented 5 years ago

It looks like this simple fix restores basic defaults functionality in v3 schemata. It fixes the MWE in #115

plk commented 5 years ago

Alright, given that you previously mentioned that you weren't even sure if defaults were supposed to work in v2, this was just a fix to bring v3 in line with the current v2 functionality since the current code just looks in the v2 location for defaults. I may or may not have time to look at comprehensive defaults functionality, this was just to make v3 basically work as v2 does.

plk commented 5 years ago

I will close this and make a new PR as I think in setting up tests, I think I have found the root of the other v3 issues I have been having. It explains why your tests work as I am using the default response handling and this was not working with v3. The PR will include fixes for that too. The test file I will make will test all of this.

jhthorsen commented 5 years ago

If you don't have time to make a complete PR, then just mention that in the description and I might use it as inspiration for a complete fix.

Also, a PR is not complete unless it has some tests. Without a test, then there's no way for me to know if I mess up the functionality with new commits.

https://github.com/jhthorsen/mojolicious-plugin-openapi/pull/124#issuecomment-473607438