contiamo / restful-react

A consistent, declarative way of interacting with RESTful backends, featuring code-generation from Swagger and OpenAPI specs 🔥
MIT License
1.87k stars 109 forks source link

Add support for tuples #363

Closed abonifacio closed 3 years ago

abonifacio commented 3 years ago

Why

Currently if you generate types based on the following definition, age_range is typed as number[]

age_range:
  description: 'A range of passenger ages (start and end, inclusively)'
  type: array
  items:
    type: number
  minItems: 2
  maxItems: 2

As the array should only contain two items, it would be nice if it was typed as [number, number]

Note

This will conflict with #362, but if you support the idea, I'll rebase afterwards

netlify[bot] commented 3 years ago

:construction_worker: Deploy request for restful-react accepted.

:hammer: Explore the source changes: 452b627e3cc1c662979490b9cc15c3f4720a11b8

:mag: Inspect the deploy log: https://app.netlify.com/sites/restful-react/deploys/60e9bda1e47b1a00071fd7db