Skip to content

Commit

Permalink
short support
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisjkl committed Sep 11, 2023
1 parent 1b461fa commit 1a1919f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ Smithy.
| number | double | Double | |
| number | double | Double | |
| number | | Double | |
| integer | int16 | Short | |
| integer | | Integer | |
| integer | int32 | Integer | |
| integer | int64 | Long | |
Expand Down
5 changes: 5 additions & 0 deletions modules/openapi/src/internals/Extractors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ object CasePrimitive {
// type: number
case (_: NumberSchema) & NoFormat() => Some(PDouble)

// I:
// type: integer
// format: int16 | noformat
case (_: IntegerSchema) & (Format("int16")) => Some(PShort)

// I:
// type: integer
// format: int32 | noformat
Expand Down
4 changes: 4 additions & 0 deletions modules/openapi/tests/src/StructureSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ final class StructureSpec extends munit.FunSuite {
| i:
| type: integer
| format: int32
| sht:
| type: integer
| format: int16
| b:
| type: boolean
| l:
Expand All @@ -53,6 +56,7 @@ final class StructureSpec extends munit.FunSuite {
| @required
| s: String,
| i: Integer,
| sht: Short,
| b: Boolean,
| @range(min: 100)
| l: Long,
Expand Down

0 comments on commit 1a1919f

Please sign in to comment.