Skip to content

Figure why Create Api Definition by Importing OpenAPI yaml only works in http-mode #1559

@Nanashi-lab

Description

@Nanashi-lab

Currently there are two gRPC/test-framework for creating a new API

create_api_definition_request::ApiDefinition::Definition
&
create_api_definition_request::ApiDefinition::Openapi

All the current integration test only test for ApiDefinition::Definition, Add a new test for ApiDefinition::Openapi


In OpenAPI Export for API Definition, Swagger UI Binding PR #1454, There is a RoundTrip test

  1. Api Definition is created
  2. Api Definition is Exported as OpenAPI Yaml
  3. Original Api Definition is deleted
  4. New Api Definition is imported using the OpenAPI Yaml
  5. New Api Definition and Original API Definition are checked

It works and Succeeds locally (Ran it a few time), but Fails in Github Workflow (2/2)

ERROR test_export_import_api_definition_fixed{deps=EnvBasedTestDependencies}: golem_common::tracing: panic panic_info=panicked at integration-tests/tests/api/api_definition.rs:722:10:
called `Result::unwrap()` on an `Err` value: ApiDefinitionError { error: Some(BadRequest(ErrorsBody { errors: ["Invalid JSON"] })) }

The error happens in 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"))?,
                );

Having a test for create_api_definition_request::ApiDefinition::Openapi would be nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions