Skip to content

Avoid 'floating point or integer' distinction for JSON number values - #2495

Open
tomcrane wants to merge 1 commit into
mainfrom
floating-point-numbers
Open

tomcrane wants to merge 1 commit into
mainfrom
floating-point-numbers

Conversation

@tomcrane

@tomcrane tomcrane commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #2492

There is a corresponding cookbook recipes PR: IIIF/cookbook-recipes#722

Generally, use "number" rather than "floating point number", and specify in Terminology section that "Where a value is required to be an integer, this is stated explicitly, and the value MUST be a number without a fractional part."

Use both forms in examples where valid to reinforce the point (e.g., 4 and 4.5)

Additional semantic change:

instant was "positive floating point number" but is now "non-negative number" because 0 is a valid instant.

@zimeon mentions "Consider typing in the @context" - e.g., adding "@type": "xsd:double" - but this would produce RDF changes in existing IIIF? And seems to go against #1291

This bit I am unsure of:

A number may have a fractional part, and may be written in any form permitted by JSON: for example, 1985, 1985.0 and 1.985E3 are all the same number.

It's correct, but we could for reasons of clarity, disallow the exponential form.

I don't think we should, because it might leak into Manifests inadvertently through serialisation, and is not invalid.

@kirschbombe
kirschbombe self-requested a review September 23, 2026 15:19

This branch was successfully deployed

1 active deployment
staging — 164cd80d Deployed Sep 23, 2026 by github-actions[bot]
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.

4 participants