Closed ferranpujolcamins closed 4 years ago
FYI, This is the actual specification I'm trying to generate:
https://gitlab.com/uklotzde/aoide-rs/-/blob/development/resources/openapi.yaml
Ey @ferranpujolcamins! It is great you give it a try. You need to wrap attributes inside properties
section. You can find more information in swagger docs. Also you need add a required
section to avoid optionals. Example:
components:
schemas:
YYYYMMDD:
type: object
required:
- value
properties:
value:
type: integer
format: int32
I write it without check it, so it could not be perfect. Tell me if it works.
FYI. You are building an example it is not exactly the same of the specification about aoide-rs. In the specification it describes YYYYMMDD
as plain attribute because it is referenced by complex objects like ReleaseDate
(not directly in the endpoint definition of parameters). A different question is if we can define properties using references and bow-openapi will auto-generate valid models... probably not! 😿
Ah I see, thanks for the explanation! However, I thought (according to the spec) that I can define such a schema of primitive type:
Right now, we only support models... hehe! Maybe in the future ^^
Given the following schema:
bow-openapi 0.1.0 generates the following struct for YYYMMDD:
I would expect the generated struct to be something like this: