Skip to content

Recursively describes the includes of array schemas #312#313

Merged
hueniverse merged 1 commit intohapijs:masterfrom
joshuafcole:enhance/array-describe
May 21, 2014
Merged

Recursively describes the includes of array schemas #312#313
hueniverse merged 1 commit intohapijs:masterfrom
joshuafcole:enhance/array-describe

Conversation

@joshuafcole
Copy link

Fixes #312

  • Walks the rules array to find includes
  • Describes each included type
  • Pushes the descriptions onto a new .includes property of the description.

There doesn't currently seem to be a good way to get at just the includes. I could either dig into this._test or the existing description rules. I chose the latter since it felt marginally cleaner. The alternative is to track includes in the Array type, but that was a bigger change and I wanted to presume as little as possible. It's simple enough to simplify this logic to use a this._includes if that's preferred.

Similarly, I'm not currently doing this for excludes, but if that seems like good behavior it's simple enough to add.

I have some (small) stake in this from #241, as I'd need to get into the include types of arrays as well for metadata in some cases. I thought I'd try to be helpful in the meantime.

@hueniverse hueniverse added the bug label May 21, 2014
@hueniverse hueniverse added this to the 4.3.0 milestone May 21, 2014
@hueniverse hueniverse self-assigned this May 21, 2014
hueniverse pushed a commit that referenced this pull request May 21, 2014
Recursively describes the includes of array schemas #312
@hueniverse hueniverse merged commit 2c14c59 into hapijs:master May 21, 2014
hueniverse pushed a commit that referenced this pull request May 21, 2014
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Bug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Describe should also compile and describe array's rules

3 participants