Skip to content

Reporting integer as number causes issues in client generators #685

@sherlock1982

Description

@sherlock1982

Reporting integer as number causes issues in client generators and invalid according to specification

Assemblies affected

Microsoft.OpenApi.OData.Reader 1.0.9

Steps to reproduce

Generate a specification.

Expected result

Integer numbers should be exposed as integer/int32

Actual result

Integer numbers will be exposed as number/int32

Additional detail

According to specification number/int32 is invalid.
Caused by commit 95058a2

This causes warning in openapi-generator and causes all integers to become doubles in NSwag

P.S.
Ah I see what happened. Looks like there's an additional registry https://spec.openapis.org/registry/format/. These formats can be in the wild but are not in the specification at all.
Therefore openapi-generator and NSwag doesn't support it.

But I think this library should be as close to specification as possible and use integer/int32 (exists in the spec) instead of number/int32 (doesn't exist in the spec but exists in optional registry)

Similar issue for #RicoSutter/NSwag/2880

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