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

Nullable decimal type removes multipleOf #696

Closed
2 tasks done
rhwork opened this issue Mar 25, 2024 · 1 comment · Fixed by #698
Closed
2 tasks done

Nullable decimal type removes multipleOf #696

rhwork opened this issue Mar 25, 2024 · 1 comment · Fixed by #698
Labels
pkg:schema-generation question Further information is requested

Comments

@rhwork
Copy link

rhwork commented Mar 25, 2024

Documentation

  • I have consulted the documentation, and my question isn't answered there.

Nuget Package

JsonSchema.Net.Generation

Package Version

4.0.0

How can I help? Please provide as much context as possible.

If I have the following code:

        [Nullable(true)]
        [MultipleOf(0.1)]
        public decimal? Apr { get; set; }

the generated schema looks like:

    "Apr": {
      "type": [
        "number",
        "null"
      ]
    },

If I change decimal? to decimal I get:

    "Apr": {
      "type": [
        "number",
        "null"
      ],
      "multipleOf": 0.1
    },

Is it possible to achieve the second result with a nullable decimal?

Code of Conduct

  • I agree to follow this project's Code of Conduct
@rhwork rhwork added the question Further information is requested label Mar 25, 2024
@gregsdennis
Copy link
Owner

Thanks for reporting this. This is an interesting find!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:schema-generation question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants