Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Ghost
    @ghost~5bc4e95dd73408ce4fab8a26
    Have any of you had a similar issue when running the cli command api-client-generator -s ./path/to/swagger.json -o ./output and the error message says "Provided swagger file './swagger.json' is invalid?"
    Vojtech Mašek
    @vmasek

    yes, that sometimes happens. In all cases I've examined the swagger file was actually invalid. (there was problem with path or api parameter)

    What happens when you paste it in swagger editor? https://editor.swagger.io/
    Are there any errors/warnings on top? The problem is that editor/swagger is able to work even with invalid files, but in our case we don't want to risk invalid API client

    Ghost
    @ghost~5bc4e95dd73408ce4fab8a26
    Thank you for the response @vmasek ! It appears that after I took the swagger.yaml file that was generated in SwaggerHub, I was able to use that file as the source for my npm script...which worked like a charm.
    I would then ask if there are settings that would allow me break up the interface into individual models and the same with the services into separate files so I can keep them following SOLID, specifically singularity in purpose.
    I would be willing to contribute if this is not currently available.
    Vojtech Mašek
    @vmasek
    Yes, there is a support for this, that works using the "tags" in swagger. Use the --splitPathTags parameter.
    https://github.com/flowup/api-client-generator#options