Skip to content

Relationship uuid support #39

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

Closed
wants to merge 1 commit into from

Conversation

too-soon
Copy link

@too-soon too-soon commented Mar 28, 2023

Possibly fixes #40

This PR is just for demonstration and will be deleted later.

@@ -104,6 +102,14 @@ export function inputBodyPostSchema(
};

const relationships = Object.keys(relationsField).reduce((acum, item) => {
if (
Copy link
Owner

@klerick klerick Mar 29, 2023

Choose a reason for hiding this comment

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

I think, better use json schema validate uuid.
You can use additional conditional before get from metadata information about ID.
like this:

if(isUuid){
relDataType.properties.data.properties.id.pattern = '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
relDataType.properties.data.properties.id.minLength = 36
relDataType.properties.data.properties.id.maxLength = 36
}

so, before it, not need check in pipe

Copy link
Author

Choose a reason for hiding this comment

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

Awesome, I'll update my proposal later this week.

@too-soon
Copy link
Author

Closed in favour of #41

@too-soon too-soon closed this Mar 30, 2023
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.

Full uuid support for primary keys
2 participants