Skip to content

Api Definition by Importing OpenAPI yaml in integration-test #1569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Nanashi-lab
Copy link
Contributor

@Nanashi-lab Nanashi-lab commented Apr 29, 2025

closes #1559

completely fixes the issue in #1559

cause -
golem-worker-service/src/grpcapi/api_definition

            create_api_definition_request::ApiDefinition::Openapi(definition) => {
                let converted = OpenApiHttpApiDefinition(
                    serde_json::from_str(&definition).map_err(|_| bad_request("Invalid JSON"))?,
                );

fix -
Now accepts both JSON and YAML, added two more tests (works in both http-mode and grpc)
deps.done file is created while doing cargo make fix (This wasnt the case, a week+ ago)

@Nanashi-lab Nanashi-lab marked this pull request as draft April 30, 2025 07:27
@Nanashi-lab Nanashi-lab marked this pull request as ready for review April 30, 2025 09:44
@Nanashi-lab
Copy link
Contributor Author

Fixed the whole ticket

Grpc failed because it could only accept APIDefinition::OpenAPI in Json format, now it can accept both Json and Yaml

It checks for Yaml, on failure checks for Json -> and passes the value to create the api definition

There are now two more tests in integration-tests/api/api_definition.rs
create_openapi_yaml_definition and create_openapi_json_definition

Now creating api definition integration test is possible through both http and grpc mode. Please Review and Accept, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Figure why Create Api Definition by Importing OpenAPI yaml only works in http-mode
1 participant