APIM-CLI version
1.14.13
API-Management version
7.7-20250830
Bug description
When resolve_openapi_ref=true is set (as documented in the 1.14.13 release notes), the import silently aborts for OpenAPI 3.1 specs that contain boolean schema constructs (e.g. additionalProperties: false). No error is logged; the CLI connects to the API Manager, reads the spec file, then immediately logs out without importing anything.
The root cause is a dependency version mismatch bundled in 1.14.13: swagger-core-2.2.19.jar (used for OAS 3.1 serialization inside resolveReferences()) calls io.swagger.v3.oas.models.media.JsonSchema.booleanSchemaValue(Boolean), which does not exist in the bundled swagger-models-2.2.0.jar. The resulting NoSuchMethodError is a java.lang.Error, not a java.lang.Exception, so it is not caught by the catch (Exception e) handler in OAS3xSpecification.parse(). The method silently returns false, the spec type goes unrecognised, and the import is abandoned.
The feature works for OAS 3.0 specs and for OAS 3.1 specs that do not use boolean schema values.
Steps to reproduce
- Create an OpenAPI 3.1 spec (openapi: "3.1.0") that references at least one external YAML file via $ref (multi-file spec). The referenced schema must contain a boolean schema value, for example additionalProperties: false.
- Place the main spec file and its referenced files on the local filesystem so that relative paths like ./components/MySchema.yaml are resolvable from the working directory.
- Set the environment variable resolve_openapi_ref=true (lowercase, as required by EnvironmentProperties.class).
- Run the CLI:
apim-cli api import -c api-config.json -a openapi.yaml -u <user> -p <pass>
- Observe that the CLI connects, reads the spec, then immediately logs out with no import attempt and no error message.
To confirm the mismatch independently:
OpenAPIV3Parser parser = new OpenAPIV3Parser(); ParseOptions opts = new ParseOptions(); opts.setResolve(true); opts.setFlatten(true); SwaggerParseResult result = parser.readContents(oas31SpecWithBooleanSchema, null, opts); new ObjectMapper(new YAMLFactory()).writeValueAsBytes(result.getOpenAPI()); // → NoSuchMethodError: io.swagger.v3.oas.models.media.JsonSchema.booleanSchemaValue(Boolean)
Relevant log output
2026-06-19 08:27:34,181 [APIManagerCLI] INFO : API-Manager CLI: 1.14.13
2026-06-19 08:27:34,183 [APIManagerCLI] DEBUG: API-Manager CLI args: [api, import, -c, config/DEV/***/api-config-result.json, -a, openapi.yaml, -u, ***@***, -p, ***, -forceUpdate, -retryDelay, 5000]
2026-06-19 08:27:34,183 [APIManagerCLI] DEBUG: Java Version: 17.0.19
2026-06-19 08:27:34,183 [APIManagerCLI] INFO : Module: API - I M P O R T (1.14.13)
2026-06-19 08:27:34,195 [EnvironmentProperties] DEBUG: Loaded environment properties from file: env.properties
2026-06-19 08:27:34,197 [CoreParameters] INFO : Retrying unexpected API-Manager REST-API responses with a delay of 5000 milliseconds.
2026-06-19 08:27:34,539 [APIMHttpClient] DEBUG: API Manager CLI http client timeout : 30000
2026-06-19 08:27:34,542 [APIMHttpClient] DEBUG: API Manager CLI using Http(s) proxy : ***
2026-06-19 08:27:34,613 [RestAPICall] DEBUG: Http verb:POST and URI: https://***/api/portal/v1.4/login
2026-06-19 08:27:34,930 [RestAPICall] DEBUG: Http verb:GET and URI: https://***/api/portal/v1.4/currentuser
2026-06-19 08:27:35,046 [APIManagerOrganizationAdapter] WARN : Using OrgAdmin only to load all organizations.
2026-06-19 08:27:35,048 [APIManagerOrganizationAdapter] DEBUG: Load organizations from API-Manager using filter: OrgFilter [name=null, id=62a8ab92-f99e-4c99-ac0a-2a7f43c08d20]
2026-06-19 08:27:35,048 [APIManagerOrganizationAdapter] DEBUG: Load organization with URI: https://***/api/portal/v1.4/organizations/62a8ab92-f99e-4c99-ac0a-2a7f43c08d20
2026-06-19 08:27:35,048 [RestAPICall] DEBUG: Http verb:GET and URI: https://***/api/portal/v1.4/organizations/62a8ab92-f99e-4c99-ac0a-2a7f43c08d20
2026-06-19 08:27:35,154 [APIManagerOrganizationAdapter] DEBUG: Organization id to be cached : /62a8ab92-f99e-4c99-ac0a-2a7f43c08d20
2026-06-19 08:27:35,169 [RestAPICall] DEBUG: Http verb:GET and URI: https://***/api/portal/v1.4/config
2026-06-19 08:27:35,304 [APIManagerAdapter] INFO : Successfully connected to API-Manager (7.7.20230830) on: https://***
2026-06-19 08:27:35,317 [Utils] DEBUG: Handling JSON Configuration file: config/DEV/***/api-config-result.json
2026-06-19 08:27:35,454 [APIManagerOrganizationAdapter] DEBUG: Load organizations from API-Manager using filter: OrgFilter [name=***, id=null]
2026-06-19 08:27:35,454 [APIManagerOrganizationAdapter] DEBUG: Load organization with URI: https://***/api/portal/v1.4/organizations?field=name&op=eq&value=***
2026-06-19 08:27:35,454 [RestAPICall] DEBUG: Http verb:GET and URI: https://***/api/portal/v1.4/organizations?field=name&op=eq&value=***
2026-06-19 08:27:35,641 [APISpecificationFactory] INFO : Reading API-Definition (Swagger/WSDL) from file: openapi.yaml (relative path)
2026-06-19 08:27:35,656 [APISpecificationFactory] DEBUG: Handle API-Specification: openapi: "3.1.0"
info:
title: ***
description: ***
termsOfService: 'urn:tos'
contact: { }
license:
name: Unlicensed
identifier: this
version: 0.2.0
se... , apiDefinitionFile: openapi.yaml , API Name : ***
2026-06-19 08:27:35,731 [APISpecification] DEBUG: YAML API-Definition detected
2026-06-19 08:27:35,954 [APIManagerAdapter] DEBUG: Closing cache ...
2026-06-19 08:27:35,954 [RestAPICall] DEBUG: Http verb:DELETE and URI: https://***/api/portal/v1.4/login
APIM-CLI version
1.14.13
API-Management version
7.7-20250830
Bug description
When resolve_openapi_ref=true is set (as documented in the 1.14.13 release notes), the import silently aborts for OpenAPI 3.1 specs that contain boolean schema constructs (e.g. additionalProperties: false). No error is logged; the CLI connects to the API Manager, reads the spec file, then immediately logs out without importing anything.
The root cause is a dependency version mismatch bundled in 1.14.13: swagger-core-2.2.19.jar (used for OAS 3.1 serialization inside resolveReferences()) calls io.swagger.v3.oas.models.media.JsonSchema.booleanSchemaValue(Boolean), which does not exist in the bundled swagger-models-2.2.0.jar. The resulting NoSuchMethodError is a java.lang.Error, not a java.lang.Exception, so it is not caught by the catch (Exception e) handler in OAS3xSpecification.parse(). The method silently returns false, the spec type goes unrecognised, and the import is abandoned.
The feature works for OAS 3.0 specs and for OAS 3.1 specs that do not use boolean schema values.
Steps to reproduce
apim-cli api import -c api-config.json -a openapi.yaml -u <user> -p <pass>To confirm the mismatch independently:
OpenAPIV3Parser parser = new OpenAPIV3Parser(); ParseOptions opts = new ParseOptions(); opts.setResolve(true); opts.setFlatten(true); SwaggerParseResult result = parser.readContents(oas31SpecWithBooleanSchema, null, opts); new ObjectMapper(new YAMLFactory()).writeValueAsBytes(result.getOpenAPI()); // → NoSuchMethodError: io.swagger.v3.oas.models.media.JsonSchema.booleanSchemaValue(Boolean)Relevant log output