Add the ability to remove the bits of JSON Schema that Swagger doesn't support#7
Add the ability to remove the bits of JSON Schema that Swagger doesn't support#7calvin1864 wants to merge 1 commit intoAPIDevTools:masterfrom
Conversation
…t support If you're already working with JSON Schema validation tools, then this functionality makes using Swagger for documentation easier
|
Thanks for the PR. I'm currently working on a plug-in model for Swagger Parser (and, by extension, Swagger CLI), and I think this is a perfect example of something that would make a great plug-in. So, I'll leave this PR open for now, and once I have all the plug-in stuff in place, you or I can refactor this to be a plug-in. |
allonzy
left a comment
There was a problem hiding this comment.
Wanted to do the same thing, using jsonSchema as openapi fragment is so underated, it allow for runtime validation, interface generation (in ts, java ...)
|
It's been so long I forgot this PR existed. Um. I assume what I wrote 5.5 years ago isn't fully compatible with what's here. Let me know if it's even worthwhile to adapt my new flag to what's here (or the plugin system if that ever came to be) |
|
Nah, don't bother we migrated to redocly |
I ran into a case where I needed to support JSON Schema files for validating an API (that contained code I didn't control) and creating documentation in Swagger.
So I created 'swagger bundle -j' which bundles swagger files and removes JSON Schema bits that Swagger refuses to understand ('id', '$schema'). Doing this allows me to maintain one set of files for two separate sets of tools
If you think this would be useful to others, feel free to merge. This is my first PR, so if you see anything that looks wrong/off, let me know. This comes with a test case, but I was having trouble running all tests on my Windows machine. I assume this works better on your box.