Skip to content
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

[RND-651] Ability to loosely allow overposted material for parity #314

Merged
merged 12 commits into from
Nov 13, 2023

Conversation

jleiva-gap
Copy link
Contributor

@jleiva-gap jleiva-gap commented Nov 3, 2023

Allow Overposting for resource.
Query parameter don't allow overposting.
Add unit and integration test.

Description

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have signed all of the commits on this PR.
  • I have agreed to the Ed-Fi Individual Contributors' License
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@jleiva-gap jleiva-gap force-pushed the RND-651-IntegrationTests branch from 094057a to c798e2c Compare November 6, 2023 20:15
Add integration test for Get, Update and Upsert
Move initializeAjv to initializeAjv after clear the cache when tests are running
Add schema validator to have a cache for body and a separate cache for query parameters.
Add conditions to avoid using ALLOW_OVERPOSTING if we are validating a query parameter schema.
Update unit and integration tests.
@jleiva-gap jleiva-gap marked this pull request as ready for review November 6, 2023 20:33
@jleiva-gap jleiva-gap marked this pull request as draft November 6, 2023 20:38
Add integration test for Get, Update and Upsert
Add schema validator to have a cache for body and a separate cache for query parameters.
Add conditions to avoid using ALLOW_OVERPOSTING if we are validating a query parameter schema.
Update unit and integration tests.
Enable test.
Fix test to match RND-651 changes
@jleiva-gap jleiva-gap changed the title [RND-651] Integration tests [RND-651] Ability to loosely allow overposted material for parity Nov 7, 2023
@jleiva-gap jleiva-gap marked this pull request as ready for review November 7, 2023 17:58
const removeAdditional = false; // TODO: replace on merge with RND-651
function initializeAjv(isQueryParameterValidator: boolean): Ajv {
// A query parameter validator cannot have additional properties
const removeAdditional = isQueryParameterValidator ? false : getBooleanFromEnvironment('ALLOW_OVERPOSTING', false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Interestingly, the ODS/API does not reject spurious query string values. However, I agree with the approach here in Meadowlark. We should let people know that their query string was invalid.

@stephenfuqua stephenfuqua merged commit 9920048 into main Nov 13, 2023
13 checks passed
@stephenfuqua stephenfuqua deleted the RND-651-IntegrationTests branch November 13, 2023 19:28
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