Skip to content

fix: map int/long value objects to JsonSchemaType.Integer, not Number - #973

Open
Arslan-TR wants to merge 1 commit into
SteveDunn:mainfrom
Arslan-TR:fix/968-openapi-int-mapping
Open

Arslan-TR wants to merge 1 commit into
SteveDunn:mainfrom
Arslan-TR:fix/968-openapi-int-mapping

Conversation

@Arslan-TR

Copy link
Copy Markdown

What

The Swashbuckle mapping generator's type lookup table (GenerateCodeForOpenApiSchemaCustomization.cs) maps every other integral type to JsonSchemaType.Integer: byte, sbyte, short, ushort, uint, ulong, Int128, UInt128. But int and long were mapped to JsonSchemaType.Number instead - inconsistent with the rest of the table, and with the OpenAPI spec where Number is meant for floating-point types.

Fix

Change the int and long entries to JsonSchemaType.Integer, matching every other integral type in the same table (the Format stays int32/int64 as before).

Fixes #968

The Swashbuckle mapping generator's type lookup table maps every other
integral type (byte, sbyte, short, ushort, uint, ulong, Int128,
UInt128) to JsonSchemaType.Integer, but int and long were mapped to
JsonSchemaType.Number - inconsistent with the rest of the table and
with the OpenAPI spec, where Number covers floating-point types.

Fixes SteveDunn#968

This branch has not been deployed

No deployments
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.

Swagger generation maps int value objects to JsonSchemaType.Number instead of JsonSchemaType.Integer

1 participant