usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
25.28k stars 1.15k forks source link

Work directly with or autoimport OpenAPI V3 spec files #1354

Open joaoportela opened 8 months ago

joaoportela commented 8 months ago

I can import my openapi.yaml file as a new collection in bruno. But, that's it.

If I generate a new OpenAPI spec file using swagger I have to remove and add the collection again.

subiabre commented 3 months ago

@sanjai0py @helloanoop This is pretty big, if you ask me, feature currently missing from Bruno.

What is the way to go when working with OpenApi specs that change over time?

MrAlucardDante commented 3 months ago

IMO Bruno CLI should evolve to give us an option to import/update collections based on an OpenAPI spec.

In Postman, you can import your OpenApi spec, which then generates your collections. If you update the spec, you can then update the collections.

Our use case is that our CI pipelines generates our OpenApi specs from our code. It would then be useful if the CLI could updates our Bruno collections automatically with the newly generated OpenApi.

izzqz commented 3 months ago

I would like to use something like this:

bru import --collection {collection_path} --spec-file ./openapi.json

Where bruno update exiting collection and keeps envs, scripts, tests etc. But idk how to handle base_url env in this case for example. Maybe bruno should be smart about it, and compare path endings?

midasvo commented 2 months ago

I'm currently developing an application based on OpenAPI specs that are still in development as well, I'm really mising the option to update the collection based on the new specs. A start could even be throwing away / regenerating the actual request files but keeping everything else e.g. environment configurations.