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

Automatically include _rawData in schema for entities #1016

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

Nick-NCSU
Copy link
Contributor

@Nick-NCSU Nick-NCSU commented Jan 11, 2024

Currently when validating graph object's schema with additionalProperties: false you are required to add _rawData as a property (As seen here)

This will remove automatically add the property to the schema to prevent this need.

@Nick-NCSU Nick-NCSU requested a review from a team as a code owner January 11, 2024 18:30
i5o
i5o previously approved these changes Jan 12, 2024
Comment on lines 612 to 615
const data = {
...received[i],
};
delete data._rawData;
Copy link
Member

@zemberdotnet zemberdotnet Jan 12, 2024

Choose a reason for hiding this comment

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

const {
   _rawData,
   ...data
} = received[i];

Can we do this to not mutate the object?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I guess it is a copy of the object. Should be fine then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it would have only removed it from data since it was a shallow copy

@Nick-NCSU Nick-NCSU requested a review from a team January 12, 2024 20:57
@Nick-NCSU Nick-NCSU changed the title Ignore raw data when validating graph object schema Automatically include _rawData in schema for entities Jan 16, 2024
@Nick-NCSU Nick-NCSU merged commit dc883ac into main Jan 16, 2024
7 checks passed
@Nick-NCSU Nick-NCSU deleted the ignore-rawdata-schema branch January 16, 2024 18: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.

3 participants