Skip to content

Conversation

@ivan-tymoshenko
Copy link
Member

@ivan-tymoshenko ivan-tymoshenko commented May 31, 2022

Object properties, additional object properties, and pattern object properties were processed by three different functions. I removed duplication. These three implementations had different ways to deal with array coercion. If it was an object property with array type it checked with Array.isArray function. If it was an additional or pattern property it didn't check but coerced to an array type in an unacceptable (IMHO) way.

Now it always checks the array typed value with Array.isArray function.

t.equal('{"foo":["t","r","u","e"],"ofoo":[],"arrfoo":["1","2"],"objfoo":[]}', stringify(obj))

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit fdb820d into fastify:master Jun 1, 2022
@ivan-tymoshenko ivan-tymoshenko deleted the use-buildValue-for-additional-and-pattern-properties branch June 1, 2022 13:52
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