Skip to content

inf default value cannot be encoded in many languages #93

@andreaTP

Description

@andreaTP

Hi there 👋 and thanks a lot for sharing this spec as it immensely helps!

I'm working on Kiota and while generating clients for your OpenAPI specification I faced a few issues and reported them, but, in this case, I'm convinced that the specification that can be improved.
Here you are defining the default value of an integer with the string "inf" and here I reported upstream the bug found.

Still, there is room for improvement:

  • inf in languages where the integer type is translated(according to the spec) as a Long/Int64 an infinite value is not easily representable
  • using inf as a valid value is only possible in languages that are using Double, BigInt or similar encodings for all of the numeric values
  • inf is effectively a string here and its meaning can vary across different target languages (I'm failing to find a spec that defines this specific string as a valid integer value)

I think that a sensible default would be the value of 32768 since, according to the docs, is currently the maximum number of tokens for the biggest available model.
I'm happy to open a PR if this is the desired resolution of the issue 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions