Skip to content

Conversation

@VShingala
Copy link
Member

@VShingala VShingala commented Apr 7, 2020

Issue : postmanlabs/postman-app-support#8098

Bug was happening due to always overriding minItems and maxItems properties to 2 for type: array in deref.resolveRefs().

Added support for Resolving refs for CONVERSION/VALIDATION in deref.resolveRefs() function.

@VShingala VShingala requested a review from abhijitkane April 7, 2020 10:50
lib/deref.js Outdated
RESPONSE: 'RESPONSE'
},
// Specifies type of Resolving of Refs that can be performed
RESOLVE_REFS_FOR = {
Copy link
Member

Choose a reason for hiding this comment

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

this seems incorrectly named
the validation/conversion should be in a different enum - PROCESSING_TYPE, for example

RESPONSE_BODY: 'response body'
},
// Specifies types of Resolving of Refs that can be performed
RESOLVE_REFS_FOR = {
Copy link
Member

Choose a reason for hiding this comment

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

this enum should only be defined in one place

lib/deref.js Outdated
// This nonsense is needed because the schemaFaker doesn't respect options.maxItems/minItems
schema.maxItems = 2;
schema.minItems = 2;
// Set minItems and maxItems property as 2 for CONVERSION
Copy link
Member

Choose a reason for hiding this comment

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

also explain why
I can tell that you're setting max/min to 2 for conversion. The comment should explain why you're not doing that for validation

…TYPE and added decriptive comment for setting minItems and maxItems properties to 2
@abhijitkane abhijitkane merged commit eb5cc8e into develop Apr 13, 2020
@umeshp7 umeshp7 deleted the feature/support-resolveref-for-validation branch November 24, 2021 06:38
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.

3 participants