feat: support openapi yaml include validation#3451
Conversation
jfuss
left a comment
There was a problem hiding this comment.
Thank you for the contribution!
Just a couple small comments. If you could address those, that would be awesome.
tests/unit/commands/validate/lib/test_sam_template_validator.py
Outdated
Show resolved
Hide resolved
Change to use pathlib. Move debug log statement to before next statement. Remove unused test file.
fix: add debug message when import file can't be found
|
@jfuss any chance of getting this across the line? |
|
@NickHeap2 Apologizes on the slow response here. I was on parental leave. I am getting back and collecting the PRs I need to respond too and looking to scope time in the coming weeks to tackle them in batches. |
jfuss
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the contribution @NickHeap2
I will find another member of the team to review as well (as we required two approvals).
This reverts commit f48262d.
|
Hi @NickHeap2, we have to revert the changes due to the bug reported in this issue#3676 by PR#3685. The validation failed when the location is an intrinsic function like |
|
OK @mingkun2020 I'll get the change reworked as soon as I get a chance. |
* feat: allow include of openapi definition to pass validation * fix: type error * chore: increase unit test coverage * chore: black format change * chore: add more tests * fix: cleanup for pr Change to use pathlib. Move debug log statement to before next statement. Remove unused test file. * fix: use mocks instead of file system * feat: integration tests fix: add debug message when import file can't be found Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com>
Which issue(s) does this change fix?
#3041
Why is this change necessary?
If you are using OpenAPI yaml specifications it makes sense to use them for the API DefinitionBody like this:
Whilst this is valid in a template it is currently not supported by sam validate.
How does it address the issue?
This change detects this pattern and replaces the DefinitionBody with the actual contents of the file allowing the validation to succeed.
What side effects does this change have?
Potentially someone could be relying on the existing behaviour where it fails for this pattern to prevent that pattern being used.
Checklist
make prpassesmake update-reproducible-reqsif dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.