OpenAPITools / openapi-generator-bazel

Bazel plugin for OpenAPI Generator
Apache License 2.0
66 stars 46 forks source link

update `openapi_generator()` to accept multiple spec files #52

Open lazcamus opened 1 year ago

lazcamus commented 1 year ago

Alter the openapi generator invocation to generate multiple -i spec.yaml parameters on the command line.

Tests pass, and I added a multiple file test for the petstore-separate example from the openapi spec

This should fix issue 27

Note: it breaks backwards compatibility

I renamed spec to specs and require a list as input. Callers who do not update will see:

% bazel query //...            
ERROR: /Users/laz/git/openapi-generator-bazel/internal/test/BUILD.bazel:5:18: //internal/test:petstore: no such attribute 'spec' in '_openapi_generator' rule (did you mean 'specs'?)
ERROR: /Users/laz/git/openapi-generator-bazel/internal/test/BUILD.bazel:5:18: //internal/test:petstore: missing value for mandatory attribute 'specs' in '_openapi_generator' rule
ERROR: package contains errors: internal/test
ERROR: package contains errors: internal/test: //internal/test:petstore: no such attribute 'spec' in '_openapi_generator' rule (did you mean 'specs'?)
ERROR: Error evaluating '//...': error loading package 'internal/test': Package 'internal/test' contains errors