Skip to content

Commit

Permalink
Add loose_id field. (#138)
Browse files Browse the repository at this point in the history
* Add field used by Go SDK

* Fix problems caused by an optional field

* Fix linter error

* Update to match final changes in the Go SDK

* Pass in proper value into super class
  • Loading branch information
jaredoconnell authored Aug 30, 2024
1 parent 6c92834 commit b87ebc8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/arcaflow_plugin_sdk/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2522,6 +2522,12 @@ class ObjectSchema(_JSONSchemaGenerator, _OpenAPIGenerator):
_name("Properties"),
_description("Properties of this object."),
]
id_unenforced: typing.Annotated[
typing.Optional[bool],
_name("ID Unenforced"),
_description("If true, the ID does not need to match another object "
"for them to be considered compatible."),
] = None

def _to_jsonschema_fragment(
self, scope: typing.ForwardRef("ScopeSchema"), defs: _JSONSchemaDefs
Expand Down Expand Up @@ -4887,13 +4893,14 @@ class ObjectType(ObjectSchema, AbstractType, Generic[ObjectT]):
You can now use the object_type to unserialize, validate, and serialize properties.
""" # noqa: E501

_cls: Type[ObjectT]
properties: Dict[str, PropertyType]
_cls: Type[ObjectT] = None
properties: Dict[str, PropertyType] = None
id_unenforced: Optional[bool] = None

def __init__(
self, cls: Type[ObjectT], properties: Dict[str, PropertyType]
):
super().__init__(cls.__name__, properties)
super().__init__(cls.__name__, properties, self.id_unenforced)
self._cls = cls
self._validate_config(cls, properties)

Expand Down

0 comments on commit b87ebc8

Please sign in to comment.