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

Openapi no additional properties take two #383

Merged
merged 5 commits into from
Mar 20, 2024

Conversation

EMaksy
Copy link
Member

@EMaksy EMaksy commented Mar 18, 2024

Description

This PR aims to fix the properties of OpenApi Schemas for wanda.
This change involves mostly changes in the schemas.

Adding additionalProperties: false to schemas to ensure which properties are expected in request and response payloads to enforce stricter validation of input data.

Additionally, the view had to be adjusted to filter out the warning message from v1.
Updated catalog factory and fixed existing tests

@coveralls
Copy link
Collaborator

coveralls commented Mar 18, 2024

Coverage Status

coverage: 95.056% (+0.01%) from 95.045%
when pulling f3b8a06 on openapi_no_additional_properties_take_two
into 1dcb3df on main.

@EMaksy EMaksy force-pushed the openapi_no_additional_properties_take_two branch from b206925 to efabcf9 Compare March 18, 2024 13:16
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Looking good.
Some comments from my side

test/support/factory.ex Outdated Show resolved Hide resolved
test/support/factory.ex Outdated Show resolved Hide resolved
lib/wanda_web/schemas/v1/catalog/check.ex Show resolved Hide resolved
lib/wanda_web/schemas/v3/catalog/check.ex Outdated Show resolved Hide resolved
lib/wanda_web/views/v1/catalog_view.ex Outdated Show resolved Hide resolved
test/support/factory.ex Show resolved Hide resolved
test/wanda_web/views/v1/catalog_view_test.exs Outdated Show resolved Hide resolved
test/wanda_web/views/v1/catalog_view_test.exs Outdated Show resolved Hide resolved
@EMaksy EMaksy force-pushed the openapi_no_additional_properties_take_two branch from 98706b2 to 37c9c7b Compare March 19, 2024 13:04
@EMaksy EMaksy force-pushed the openapi_no_additional_properties_take_two branch 5 times, most recently from 18b910f to 4d91f0e Compare March 19, 2024 15:54
@EMaksy EMaksy marked this pull request as ready for review March 19, 2024 16:00
@EMaksy EMaksy requested a review from arbulu89 March 19, 2024 16:00
@EMaksy EMaksy force-pushed the openapi_no_additional_properties_take_two branch from 4d91f0e to ea5233b Compare March 20, 2024 08:44
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Thanks!
A couple of nitpics. Ready to merge

test/support/factory.ex Outdated Show resolved Hide resolved
test/wanda_web/views/v2/catalog_view_test.exs Outdated Show resolved Hide resolved
@EMaksy EMaksy merged commit def1f36 into main Mar 20, 2024
13 checks passed
@EMaksy EMaksy deleted the openapi_no_additional_properties_take_two branch March 20, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants