Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Allow specify SWAGGER spec's file from url, to support local development #316

Closed
fncap opened this issue Jan 15, 2022 · 7 comments · Fixed by #338
Closed

[FEATURE] Allow specify SWAGGER spec's file from url, to support local development #316

fncap opened this issue Jan 15, 2022 · 7 comments · Fixed by #338
Assignees
Labels
enhancement New feature or request

Comments

@fncap
Copy link

fncap commented Jan 15, 2022

Actually, the generator accepts a folder within it searches for all swagger specs files.
This behavior fits very well for a 3rdy party WebAPI.
In the scenario, where the WebAPI layer is parallel developed with the app, it could be annoying to copy/paste our swagger file to that folder!
Instead, should be a big improvement if the generator could download it from an URL!

Please take a look at the following build.yaml part:

      swagger_dart_code_generator:
        options:
          #instead of this -> input_folder: "swaggers/"
          input_urls: 
           - https://localhost:9001/module1/swagger.json
           - https://localhost:9001/module2/swagger.json
           - https://petstore.swagger.io/v2/swagger.json
          output_folder: "lib/swagger_generated_code/"

NOTE
It should be helpful if URLs will be managed for local SSL cert, avoiding annoying problem about INVALID_SSL_CERT

Thanks for your time!

@fncap fncap added the enhancement New feature or request label Jan 15, 2022
@fncap
Copy link
Author

fncap commented Feb 1, 2022

Any updates?

@Vovanella95
Copy link
Collaborator

Hi @fncap
Unfortunately no updated for now. I will try to investigate this thing this week.

@Vovanella95
Copy link
Collaborator

Vovanella95 commented Feb 1, 2022

Hi @fncap

You can try to use package version from git branch. Not it's in beta.
IMPORTANT: you still need to have at least one .swagger/.json file in you input folder. I will check if it's possible to rid of it later. Please check example in version/2.3.14 branch. Let us know in case of issues.

!!!UPDATE. There is only one condition at this moment: you should have lib/main.dart file.

@fncap
Copy link
Author

fncap commented Feb 1, 2022

Many thanks! I'll give it a try and report back!!!

@Vovanella95
Copy link
Collaborator

Hi again @fncap

Currently it's not nessessary to have main.dart file in lib folder. Just generate your code from anywhere to anywhere. I hope it will be released soon.

Please use version/2.4.0-prerelease.1 branch to test it.

@fncap
Copy link
Author

fncap commented Feb 3, 2022

Hi @Vovanella95 !
Just tried suggested branch, and it works like a charm!
Many thanks for your work!
This tool is a killer-time for me!!!

@Vovanella95
Copy link
Collaborator

@fncap thanks for your feedback. Possible, will change this feature a bit soon. But don't worry it will be not critical changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants