-
-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix logic for merging object schemas within a property #1159
base: main
Are you sure you want to change the base?
Conversation
10cae28
to
e6cdf95
Compare
prop1: Property, | ||
prop2: Property, | ||
parent_name: str, | ||
config: Config, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need parent_name
and config
now because it might be necessary to generate a new inline schema.
optional_properties: list[Property] | None = None | ||
additional_properties: Property | None = None | ||
relative_imports: set[str] = field(factory=set) | ||
lazy_imports: set[str] = field(factory=set) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is similar to the _PropertyData
class that previously existed just to be a return type for _process_properties
. Since they were so close already, and ModelProperty
also had all of these properties, I figured it made sense to encapsulate them and have ModelProperty
just own an instance of this class. I added accessor methods so that model.required_properties
still works as an alias for model.details.required_properties
.
fccd382
to
c363974
Compare
Fixes #1123.
Details are as described in the changeset.
This is a breaking change only in cases where the previous logic was producing an unambiguously wrong result. That is, in the example shown in the changeset, any code that had previously relied on
ModelB.result
being an instance ofBaseResult
rather thanExtendedResult
would now fail.