Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Added union type definition support #6

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

Merged
merged 4 commits into from
Sep 4, 2019
Merged

Added union type definition support #6

merged 4 commits into from
Sep 4, 2019

Conversation

walangkaji
Copy link
Contributor

#5

@@ -48,11 +48,12 @@ $validator->defineType('User', [
'name' => 'string',
'gender' => 'string',
'age' => '?integer',
'rating' => '?integer,?boolean',
Copy link
Member

Choose a reason for hiding this comment

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

The syntax should be like this: ?integer|boolean, the question mark indicates the field is nullable, and | indicates the field accepts an integer or boolean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice, let me try

@bixuehujin
Copy link
Member

BTW, Can you add a test case for this?

@walangkaji
Copy link
Contributor Author

hi @bixuehujin
check is there any mistake

@bixuehujin bixuehujin changed the title Support multiple allowed definition type Added union type definition support Sep 4, 2019
@bixuehujin
Copy link
Member

lgtm, merged

@bixuehujin bixuehujin merged commit b83e8f7 into rethinkphp:master Sep 4, 2019
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.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.