Datamodel-code-generator: Support for remote $refs

Created on 19 Jun 2020  路  6Comments  路  Source: koxudaxi/datamodel-code-generator

Is your feature request related to a problem? Please describe.

Remote $ref are not resolved

Describe the solution you'd like

Remote $ref to be resolved

Describe alternatives you've considered

Remote $refs are downloaded and converted to local refs by an external component

Additional context

components:
  schemas:
    Problem:
      $ref: "https://opensource.zalando.com/problem/schema.yaml#/Problem"

enhancement released

Most helpful comment

Thank you very much :) These days I was attending EuroPython online edition and I shared your work with the community. Next week I'll push some more tests. Thanks for your great work!

All 6 comments

@ioggstream
OK, I try to implement it :nerd_face:

@koxudaxi Great! I stubbed an openapi-resolver here https://github.com/ioggstream/openapi-resolver which cover some use cases but has a non-trivial bug with multi-level $refs https://github.com/ioggstream/openapi-resolver/issues/26

The resolver can recursively download $refs and generate a single, bundled, OAS spec trying to preserve relationship between classes and can be an initial building block for fixing the issue.

@ioggstream
I published the feature as 0.5.19.

@ioggstream
I don't use your library because of cutting dependency.
Also, I decide I don't need it this phase.

Thank you very much :) These days I was attending EuroPython online edition and I shared your work with the community. Next week I'll push some more tests. Thanks for your great work!

@ioggstream
Thank you for sharing my work :smile:

Next week I'll push some more tests.

Great!! I will review it :+1:

Also, I'll update fastapi-code-generator for remote files and documents :wink:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HuiiBuh picture HuiiBuh  路  4Comments

fzirker picture fzirker  路  6Comments

FlorianLudwig picture FlorianLudwig  路  3Comments

mboutet picture mboutet  路  3Comments

scottcarr picture scottcarr  路  3Comments