openapistack / openapicmd

The CLI for all things OpenAPI and Swagger
https://openapistack.co
MIT License
55 stars 9 forks source link

Remove referenced components after dereferencing #14

Closed RemiBardon closed 2 years ago

RemiBardon commented 3 years ago

After a openapi read ./foo.json -f json -D > bar.json, parameters, schemas, requestBodies, responses and examples are still present in components. They are useless, since they have been dereferenced.

I dereferenced a 1500 lines file, and it gave me 9700 lines. After removing useless components, I went back to 4000 lines (which is a lot better).

anttiviljami commented 2 years ago

The dereferencing is done by @apidevtools/swagger-parser. Closing :)