Skip to content

module validation #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 27, 2020
Merged

Conversation

jeromevdl
Copy link
Contributor

Issue #, if available:

Description of changes:

Validation module, permits to validate events and responses agains JSON schema

Checklist

Breaking change checklist

RFC issue #:

  • Migration process documented
  • Implement warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@msailes
Copy link
Contributor

msailes commented Oct 26, 2020

Is there any way we can eagerly load the schema from file during init phase?

@jeromevdl
Copy link
Contributor Author

Is there any way we can eagerly load the schema from file during init phase?

You could use the Validator.getJsonSchema("classpath:/schema.json") out of the handler, so that it is loaded and cached. Not sure how to do it transparently for the developer.
But at least, once loaded, it is cached so it will be reloaded only for new lambda instances.


### @Validation annotation

`@Validation` annotation is used to validate either inbound or functions' response.
Copy link
Contributor

Choose a reason for hiding this comment

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

@Validation annotation is used to validate either inbound or functions' response.

to

@Validation annotation is used to validate either inbound events or functions' response.

Copy link
Contributor

@msailes msailes left a comment

Choose a reason for hiding this comment

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

approved

@msailes msailes merged commit 91c7ecf into aws-powertools:master Oct 27, 2020
@jeromevdl jeromevdl deleted the module-validation branch November 4, 2022 10: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