Skip to content

Introduce schema.any#21775

Merged
azasypkin merged 2 commits intoelastic:masterfrom
azasypkin:issue-xxx-core-schema-any
Aug 9, 2018
Merged

Introduce schema.any#21775
azasypkin merged 2 commits intoelastic:masterfrom
azasypkin:issue-xxx-core-schema-any

Conversation

@azasypkin
Copy link
Copy Markdown
Contributor

@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 Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// Feature:New Platform labels Aug 8, 2018
@azasypkin azasypkin requested review from epixa, rhoboat and spalger August 8, 2018 06:19
@elasticmachine
Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown
Contributor 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
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor 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 Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v6.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants