Skip to content

Commit

Permalink
fix: map int types to number OAS type
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Oct 24, 2024
1 parent ce64230 commit cd6c27e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Microsoft.OpenApi/Extensions/OpenApiTypeMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public static class OpenApiTypeMapper
/// Other types including nullables and URL are also supported.
/// Common Name type format Comments
/// =========== ======= ====== =========================================
/// integer integer int32 signed 32 bits
/// long integer int64 signed 64 bits
/// integer number int32 signed 32 bits
/// long number int64 signed 64 bits
/// float number float
/// double number double
/// string string [empty]
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi/Validations/Rules/RuleHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public static void ValidateDataTypeMismatch(

if (type == "number")
{
if (value is not OpenApiDouble)
if (value is not OpenApiDouble or OpenApiInteger or OpenApiFloat or OpenApiLong)
{
context.CreateWarning(
ruleName,
Expand Down

0 comments on commit cd6c27e

Please sign in to comment.