Skip to content

Mark some properties in the all.yaml file as required #280

@ognis1205

Description

@ognis1205

Describe the bug

I'm working on converting the OpenAPI specification to TypeScript interfaces. I have found some properties are nullable while they should be (potentially) required, e.g., I guess the name and catalog_name of SchemaInfo should be required:

https://github.com/unitycatalog/unitycatalog/blob/main/api/all.yaml#L995

To Reproduce

I'm using openapi-typescript to convert the specification.

Steps to reproduce the behavior:

  1. npx openapi-typescript /path/to/spec/api.yaml --output /path/to/output/schema.ts

Expected behavior

Some output properties should not be Optional in a typed language like TypeScript.

Additional context

Basically, it’s not that problematic, but when using a typed language, it gets converted to Optional (in TypeScript, fields with a ? suffix), which can be a bit cumbersome during type checking and type guarding. It would be helpful if the OpenAPI spec could include required fields.

Screenshot 2024-07-25 at 13 11 59 Screenshot 2024-07-25 at 13 12 19

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions