diff --git a/etc/openapi.yaml b/etc/openapi.yaml index ecd4c605..105dea1a 100644 --- a/etc/openapi.yaml +++ b/etc/openapi.yaml @@ -256,6 +256,26 @@ paths: description: OK components: schemas: + Action: + description: Executable action + enum: + - SUBSCRIBE + - UNSUBSCRIBE + type: string + Command: + description: Action to execute for a share + required: + - action + - key + type: object + properties: + action: + $ref: '#/components/schemas/Action' + key: + description: the share + type: string + xml: + name: command error: description: Structured error message type: object diff --git a/src/main/java/x1/stomp/boundary/OpenAPIModelBuilder.java b/src/main/java/x1/stomp/boundary/OpenAPIModelBuilder.java index 9bd38bcd..640d45d3 100644 --- a/src/main/java/x1/stomp/boundary/OpenAPIModelBuilder.java +++ b/src/main/java/x1/stomp/boundary/OpenAPIModelBuilder.java @@ -45,14 +45,12 @@ public OpenAPI buildModel() { try { LOCK.await(); + // add server by a relative url: works only if using swagger UI deployed with the application + var server = OASFactory.createServer().description("stage").url(servletContext.getContextPath()); + openAPI.addServer(server); } catch (InterruptedException e1) { - return openAPI; + // ignore } - - // add server by a relative url: works only if using swagger UI deployed with - // the application - var server = OASFactory.createServer().description("stage").url(servletContext.getContextPath()); - openAPI.addServer(server); return openAPI; } diff --git a/src/test/java/x1/stomp/test/SchemaExportTest.java b/src/test/java/x1/stomp/test/SchemaExportTest.java index 102dc585..ae37e600 100644 --- a/src/test/java/x1/stomp/test/SchemaExportTest.java +++ b/src/test/java/x1/stomp/test/SchemaExportTest.java @@ -18,7 +18,7 @@ public void testSchemaExport() { MetadataSources metadata = new MetadataSources( new StandardServiceRegistryBuilder().applySetting(AvailableSettings.DIALECT, PostgreSQLDialect.class.getName()) .applySetting(AvailableSettings.DEFAULT_SCHEMA, "stocks").build()); - new SchemaExport().setOutputFile("target/ddl.sql").setFormat(true).create(EnumSet.of(TargetType.SCRIPT), + new SchemaExport().setOutputFile("target/generated/ddl.sql").setFormat(true).create(EnumSet.of(TargetType.SCRIPT), metadata.addAnnotatedClass(Share.class).buildMetadata()); } }