Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…mgen into pydantic
  • Loading branch information
chicco785 committed Aug 3, 2023
2 parents 4644df6 + 4109aad commit a654cc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cimgen Release Notes

## 0.0.1-dev - 2023-08-02
## 0.0.1-dev - 2023-08-03

### Features

Expand Down
14 changes: 7 additions & 7 deletions pydantic/langPack.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ def _set_validator(text, render):
elif attribute["label"] == "mRID":
return (
'@field_validator("mRID", mode="before")\n'
+' def validate_mrid_format(cls, v):\n'
+' if isinstance(v, uuid.UUID):\n'
+' return str(v)\n'
+' elif isinstance(v, str):\n'
+' return v\n'
+' else:\n'
+' raise ValueError("must be a UUID or str")\n'
+ " def validate_mrid_format(cls, v):\n"
+ " if isinstance(v, uuid.UUID):\n"
+ " return str(v)\n"
+ " elif isinstance(v, str):\n"
+ " return v\n"
+ " else:\n"
+ ' raise ValueError("must be a UUID or str")\n'
)
else:
return ""
Expand Down

0 comments on commit a654cc5

Please sign in to comment.