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

fix: changes made to the objectSchema #380

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rakeshkodathala
Copy link

@rakeshkodathala rakeshkodathala commented Feb 22, 2024

Resolves #326

As said by @Tenischev, changes have been made to the file by modifying Min and Max to DecimaMin and DecimaMax

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@rakeshkodathala rakeshkodathala changed the title changes made to objectSchema -Bug Fixes Feb 22, 2024
@rakeshkodathala rakeshkodathala changed the title -Bug Fixes A bud fix Feb 22, 2024
@rakeshkodathala rakeshkodathala changed the title A bud fix fix: A bug fix #326 Feb 22, 2024
@rakeshkodathala rakeshkodathala changed the title fix: A bug fix #326 fix: changes made to the objectSchema Feb 22, 2024
Copy link

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Jun 22, 2024
@Tenischev Tenischev removed the stale label Jun 24, 2024
@Tenischev
Copy link
Member

Hi @rakeshkodathala
I do not think that it will work as expected, please see review below

Comment on lines +149 to +150
{%- if prop.minimum() %}@Min({{prop.minimum()}}){% endif %}{% if prop.exclusiveMinimum() %}@DecimalMin({{prop.exclusiveMinimum() + 1}}){% endif %}
{%- if prop.maximum() %}@Max({{prop.maximum()}}){% endif %}{% if prop.exclusiveMaximum() %}@DecimalMax({{prop.exclusiveMaximum() + 1}}){% endif %}
Copy link
Member

Choose a reason for hiding this comment

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

The prop.minimum() means <=, the prop.maximum() means >= and exclusiveMinimum means just < and exclusiveMaximum is >.
So, change of exclusiveMinimum and exclusiveMaximum to @DecimalMin/@DecimalMax will lead to effect that all types (Integer, Long, Double e.t.c.) will have the @DecimalMin annotation.
The correct way to choose annotation between @Min and @DecimalMin, @Max and @DecimalMax would require to analyze value of {{propType}} in line below. Depending on {{propType}} the correct annotation should be set

Copy link

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support decimal min and max
2 participants