-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
What I currently have is a class like so:
class Test(BaseModel):
id: str = None
name: str = None
system_url: str
What I am trying to do is have it so that system_url is a static value that cannot be changed and shouldn't be a value that is accepted as being passed in.
I have tried to create a subclass also, however it still changes the variable if it's passed in on new instance creation.
I have thought of using a validator that will ignore the value and instead set the system property that I plan on using. However am looking for other ways that may support this. I have tried to search if this has come up before but constantly run into the JSONSchema.const field type that I feel doesn't match with what I am trying to achieve.
Your help here is greatly appreciated!
juanmirocks, fdemmer and IllyaMoskvin