APIDevTools / swagger-cli

Swagger 2.0 and OpenAPI 3.0 command-line tool
https://apitools.dev/swagger-cli
MIT License
516 stars 68 forks source link

Add the ability to remove the bits of JSON Schema that Swagger doesn't support #7

Open calvin1864 opened 8 years ago

calvin1864 commented 8 years ago

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.

JamesMessinger commented 8 years ago

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.

calvin1864 commented 2 years ago

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)

allonzy commented 2 years ago

Nah, don't bother we migrated to redocly