Skip to content

Conversation

@tillrohrmann
Copy link
Contributor

The dependency okapi_operation is no longer actively maintained and blocks Restate
from upgrading the schemars dependency. Moreover, it only generates OpenAPI 3.0 specs.

To solve this problem, this commit replaces the okapi_operation dependency with the
more actively maintained utoipa dependency which allows us to generate OpenAPI 3.1.
Moreover, it will allow us to eventually drop the restate-utoipa fork once we upstream
the added changes.

As part of this rework, we added the SQL query endpoint to the OpenAPI documentation
and removed the feature gate.

@slinkydeveloper
Copy link
Contributor

Could you post the admin openapi output here? Will run a few tests to see if it generates something sane :)

@tillrohrmann
Copy link
Contributor Author

tillrohrmann commented Jan 5, 2026

Here is the generated OpenAPI spec: https://gist.github.com/tillrohrmann/e1a4b749242f3b554ef55c3b994c434f

@slinkydeveloper
Copy link
Contributor

Copy link
Contributor

@slinkydeveloper slinkydeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the changes i posted here, code generation of the docs works fine and LGTM

@tillrohrmann
Copy link
Contributor Author

tillrohrmann commented Jan 8, 2026

@tillrohrmann this test failure is being tracked already? https://github.com/restatedev/restate/actions/runs/20754507824/job/59594780154?pr=4125#step:12:172

Not yet. Will create the corresponding issue.

The issue is #4152.

@nikrooz
Copy link
Contributor

nikrooz commented Jan 8, 2026

The GET /services/{service} endpoint returns handlers as an array, but the openapi spec display it as a dictionary
Screenshot 2026-01-08 at 11 01 40

@nikrooz
Copy link
Contributor

nikrooz commented Jan 8, 2026

I think the new OpenAPI spec for admin api is invalid. it has invalid response key, like 400 Bad Request
Screenshot 2026-01-08 at 10 53 39

@tillrohrmann
Copy link
Contributor Author

I think the new OpenAPI spec for admin api is invalid. it has invalid response key, like 400 Bad Request Screenshot 2026-01-08 at 10 53 39

@nikrooz did you try out the latest version of this PR? I've pushed an update to address the issue with the "400 Bad Request". It should now generate "400".

@tillrohrmann
Copy link
Contributor Author

/services/{service}

You are right. There is

#[serde(with = "serde_with::As::<restate_serde_util::MapAsVec>")]
pub handlers: HashMap<String, HandlerMetadata>,
which maps the map to a vec. I'll update it.

@tillrohrmann
Copy link
Contributor Author

The GET /services/{service} endpoint returns handlers as an array, but the openapi spec display it as a dictionary Screenshot 2026-01-08 at 11 01 40

You are right @nikrooz. There is

#[serde(with = "serde_with::As::<restate_serde_util::MapAsVec>")]
pub handlers: HashMap<String, HandlerMetadata>,
which maps the map to a vec. I'll update it.

The dependency okapi_operation is no longer actively maintained and blocks Restate
from upgrading the schemars dependency. Moreover, it only generates OpenAPI 3.0 specs.

To solve this problem, this commit replaces the okapi_operation dependency with the
more actively maintained utoipa dependency which allows us to generate OpenAPI 3.1.
Moreover, it will allow us to eventually drop the restate-utoipa fork once we upstream
the added changes.

As part of this rework, we added the SQL query endpoint to the OpenAPI documentation
and removed the feature gate.
@tillrohrmann tillrohrmann merged commit d13b9f5 into restatedev:main Jan 9, 2026
29 checks passed
@tillrohrmann tillrohrmann deleted the remove-okapi branch January 9, 2026 09:26
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants