Skip to content

defect in YAML for seed integer minimum: -9223372036854776000 maximum: 9223372036854776000 #464

Open
@zijianhuang

Description

@zijianhuang

https://github.com/openai/openai-openapi/blob/manual_spec/openapi.yaml , dated April 30 2025, and https://app.stainless.com/api/spec/documented/openai/openapi.documented.yml (openapi 3.1) has the same problem.

Defects in YAML

The yaml has a few defect:

            seed:
              type: integer
              minimum: -9223372036854776000
              maximum: 9223372036854776000
              nullable: true
              description: >
                This feature is in Beta.

                If specified, our system will make a best effort to sample
                deterministically, such that repeated requests with the same
                `seed` and parameters should return the same result.

                Determinism is not guaranteed, and you should refer to the
                `system_fingerprint` response parameter to monitor changes in
                the backend.
              x-oaiMeta:
                beta: true

in C# and alike as well as https://spec.openapis.org/registry/format/int64, int (Int32) ranges -2,147,483,648 to 2,147,483,647
and long (Int64) ranges -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

To compare:
9223372036854776000
9223372036854775807
-9223372036854776000
-9223372036854775808

Likely the cause could be that somewhere in the pipeline of generating the YAML file treat a larger integer as floating point, and here come the apparent rounding problem, looking like a typical rounding problem of JavaScript or alike which are lack of capability of handling large integer, while Swagger/OpenAPI has its root to JavaScript/JSON.

Therefore the fix could be simply:

            seed:
              type: integer
              format: int64
              nullable: true
              description: >
                This feature is in Beta.

                If specified, our system will make a best effort to sample
                deterministically, such that repeated requests with the same
                `seed` and parameters should return the same result.

                Determinism is not guaranteed, and you should refer to the
                `system_fingerprint` response parameter to monitor changes in
                the backend.
              x-oaiMeta:
                beta: true

If the YAML is generated, respective artifact in the pipeline needs to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions