Skip to content

Comments

Fixed security requirement resolution #226

Merged
darrelmiller merged 5 commits intomasterfrom
dm/securityrefs
Mar 20, 2018
Merged

Fixed security requirement resolution #226
darrelmiller merged 5 commits intomasterfrom
dm/securityrefs

Conversation

@darrelmiller
Copy link
Member

Fixes #222

Walk(OpenApiConstants.Callbacks, () => Walk(operation.Callbacks));
Walk(OpenApiConstants.Tags, () => Walk(operation.Tags));

Walk(OpenApiConstants.Security, () => Walk(operation.Security));
Copy link
Contributor

Choose a reason for hiding this comment

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

If we miss add the process code, it should not be failed. So, I can't understand why? Is there any default setting that we can fix it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I follow. If we are missing Walk() methods then there may be references that remain unresolved or objects not validated. Technically that's not an error as Unresolved references is a valid state. They could be resolved manually later.

Yes, there has been an unfortunate number of cases of missing resolved references. In theory these should have been picked up by regular test cases as unresolved references have null/default property values.. Not quite sure why more were not.

@xuzhg
Copy link
Contributor

xuzhg commented Mar 19, 2018

Also, I'd like we should have some test cases to cover it.

}

/// <summary>
/// Resolve all references to SecuritySchemes
Copy link
Contributor

Choose a reason for hiding this comment

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

the comments should be "SecurityRequirement" not "SecuritySchemes" ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually no. SecurityRequirement is a dictionary whose keys are SecuritySchemes. It is those keys that are being replaced if they are unresolved references.

@darrelmiller darrelmiller merged commit 80099fc into master Mar 20, 2018
@darrelmiller darrelmiller deleted the dm/securityrefs branch March 20, 2018 01:02
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