Skip to content
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

Add/hdruk/2.2 #24

Merged
merged 24 commits into from
Feb 5, 2024
Merged

Add/hdruk/2.2 #24

merged 24 commits into from
Feb 5, 2024

Conversation

calmacx
Copy link
Collaborator

@calmacx calmacx commented Jan 31, 2024

No description provided.

Base automatically changed from add/GWDM/1.1 to master February 2, 2024 10:49
@calmacx calmacx marked this pull request as ready for review February 5, 2024 10:11

| title | is_list | is_optional | required | type |
|:-------------------|:----------|:--------------|:-----------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Dataset identifier | False | True | True | ["Uuidv4[{'maxLength': 36, 'minLength': 36, 'pattern': '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$', 'type': 'string'}]", "Url[{'anyOf': [{'format': 'uri', 'minLength': 1, 'type': 'string'}, {'type': 'null'}]}]", 'null'] |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean if a field is both optional and required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice spot. Will look into this. We(I) have defined the identifier as:

identifier: Union[Uuidv4, Optional[Url]] 

in the 2.1.2 schema that this inherits.

It's got confused as Optional[type] is short-hand for Union[type,None]

So the identifier is effectively Union[Uuidv4,Url,None] which would effectively make it not required.

We wanted this because the identifier gets generated by us, i.e. the pid of a dataset. So we would overwrite whatever someone puts in as an identifier of their schema.

Will try to fix in subsequent schemas and review if this happens elsewhere

@calmacx calmacx merged commit cfe6f53 into master Feb 5, 2024
3 checks passed
@calmacx calmacx deleted the add/hdruk/2.2 branch February 5, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants