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

Introduce schema.any #21775

Merged
merged 2 commits into from
Aug 9, 2018
Merged

Conversation

azasypkin
Copy link
Member

@azasypkin azasypkin commented Aug 8, 2018

The first of the PRs extracted from #19994. It introduces schema.any (will be needed to pass legacy logging config of unknown shape to the legacy log appender that resides in the core).

Unblocks #19994

@azasypkin azasypkin added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform labels Aug 8, 2018
@azasypkin azasypkin requested review from epixa, spalger and rhoboat August 8, 2018 06:19
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

expect(schema.any().validate(true)).toBe(true);
expect(schema.any().validate(100)).toBe(100);
expect(schema.any().validate('foo')).toBe('foo');
expect(schema.any().validate({ foo: 'bar', baz: 2 })).toEqual({ foo: 'bar', baz: 2 });
Copy link

@rhoboat rhoboat Aug 8, 2018

Choose a reason for hiding this comment

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

This tests boolean, number, string, object. what about null and undefined? nevermind, we have undefined below. maybe just null?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, added a couple of expect's for null, thanks!

Copy link

@rhoboat rhoboat left a comment

Choose a reason for hiding this comment

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

Looks great! Congrats on the 1st PR. (I just made a comment about null, please ignore if it doesn't apply.)

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@azasypkin azasypkin merged commit 4cd9699 into elastic:master Aug 9, 2018
@azasypkin azasypkin deleted the issue-xxx-core-schema-any branch August 9, 2018 09:07
@azasypkin
Copy link
Member Author

6.x/6.5: 15e17aa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v6.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants