chenrui333 / rules_openapi

🍃 bazel rules for generating code from openapi specifications
MIT License
53 stars 25 forks source link

Add spec_refs to support relative $ref #44

Closed ttiurani closed 2 years ago

ttiurani commented 4 years ago

In order to be able to have refer to an external schema file, for example:

    schema:
      $ref: "./schema.json#/definitions/MyExternalType"

in the OpenAPI definition, also the external dependencies need to be copied to Bazel's private tmp cache.

To do this, a schema_refs attribute is added, and can be used like:

    openapi_gen(
      ...
      spec = "openapi.yaml",
      spec_refs = ["schema.json"]
    )
chenrui333 commented 3 years ago

Thanks @ttiurani!

ttiurani commented 3 years ago

Any chance to merge this @chenrui333 ? I'd rather use your repo instead of my own fork :)

chenrui333 commented 2 years ago

@ttiurani sorry about the delay, just merge the PR!! Thanks for the work!