ScheduleInterval schema in OpenAPI specs should have "nullable: true" otherwise generated OpenAPI client will throw an error in case of nullable "schedule_interval"
See original GitHub issueApache Airflow version
2.2.4 (latest released)
What happened
Currently we have this schema definition in the OpenAPI specs:
ScheduleInterval:
description: |
Schedule interval. Defines how often DAG runs, this object gets added to your latest task instance's
execution_date to figure out the next schedule.
readOnly: true
oneOf:
- $ref: '#/components/schemas/TimeDelta'
- $ref: '#/components/schemas/RelativeDelta'
- $ref: '#/components/schemas/CronExpression'
discriminator:
propertyName: __type
The issue with above is, when using an OpenAPI generator for Java for example (I think is same for other languages as well), it will treat ScheduleInterval as non-nullable property, although what is returned under /dags/{dag_id} or /dags/{dag_id}/details in case of a None schedule_interval is null for schedule_interval.
What you think should happen instead
We should have nullable: true in ScheduleInterval schema which will allow schedule_interval to be parsed as null.
How to reproduce
No response
Operating System
Linux
Versions of Apache Airflow Providers
No response
Deployment
Official Apache Airflow Helm Chart
Deployment details
No response
Anything else
If the maintainers think is a valid bug, I will be more than happy to submit a PR 😃
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
OpenAPI Specification - Version 3.0.3 - Swagger
The OpenAPI Specification defines a standard interface to RESTful APIs which allows both humans and computers to understand service capabilities without ...
Read more >Getting Started | DataHub
The OpenAPI UI includes explorable schemas for request and response objects that are fully documented. The models used in the OpenAPI UI are...
Read more >Using OpenAPI and Swagger UI - Quarkus
This guide explains how your Quarkus application can expose its API description through an OpenAPI specification and how you can test it via...
Read more >Documentation for the java-camel Generator
Generate an OpenAPI 3 specification using SpringDoc. springdoc. ensureUniqueParams, Whether to ensure parameter names are unique in an operation ...
Read more >Open API Server Implementation Using OpenAPI Generator
Learn how to generate a Spring-based server stub from a YAML specification using the OpenAPI generator's Maven plugin.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

From what I understand, the problem is not in the API response, but the generated API clients. The response you have above is currently not consumable by an API client. Adding
nullable: truewould allow the clients to handle"schedule_interval": nullcorrectly. The generated API clients are not a part of the main Airflow repository, but they do rely on theopenapi/v1.ymlfile in here, so we need to fix it for them.Good catch. Pull request would be very welcomed!