Skip to content
Discussion options

You must be logged in to vote

Answering myself:

  1. It is a pydantic thing after all
  2. You can override a pydantic Model's schema using the schema_extra property Config class for the Model:
class Foo(BaseModel):

    class Config:
        def schema_extra(s):
            s.clear()
            s["$ref"] = "https://example.com/api/v1/openapi.json#/components/schemas/Foo"

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@afandian
Comment options

Answer selected by booooh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
2 participants
Converted from issue

This discussion was converted from issue #4997 on February 27, 2023 21:45.