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

Use minimum and maximum value of an integer property to determine java type long #434

Merged
merged 1 commit into from
Oct 23, 2015

Conversation

benjefferies
Copy link
Contributor

Use the minimum and maximum properties as a hint to the java type of an integer.

Given the simple json object below we can infer that the type will be a long because the minimum value is to small.

{
  "type" : "object",
  "properties" : {
    "longProperty" : {
      "type" : "integer",
      "minimum": -2147483649
    }
  }
}

resolves #375

@joelittlejohn
Copy link
Owner

Excellent, thanks. Are we missing a json file here?

@benjefferies
Copy link
Contributor Author

No worries, just added it now as it was missed from previous commit. Guess CI can be kicked off again now.

@joelittlejohn
Copy link
Owner

A very thorough change, thanks! Could you squash these two commits into one please and I'll merge.

@joelittlejohn joelittlejohn added this to the 0.4.16 milestone Oct 22, 2015
@joelittlejohn joelittlejohn changed the title Use minimum and maximum value property to determine java type long. r… Use minimum and maximum value property to determine java type long Oct 22, 2015
@joelittlejohn joelittlejohn changed the title Use minimum and maximum value property to determine java type long Use minimum and maximum value of an integer property to determine java type long Oct 22, 2015
@benjefferies
Copy link
Contributor Author

@joelittlejohn I have squashed into one commit and CI is green. Ready for you to merge when you're ready

joelittlejohn added a commit that referenced this pull request Oct 23, 2015
Use minimum and maximum value of an integer property to determine java type long
@joelittlejohn joelittlejohn merged commit bf60a8b into joelittlejohn:master Oct 23, 2015
@joelittlejohn
Copy link
Owner

Brilliant, thanks!!

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.

Autodetect integer type vs long type using maximum/minimum rules
2 participants