diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/.classpath b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/.classpath
new file mode 100644
index 000000000000..61e710c1a5e5
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/.classpath
@@ -0,0 +1,11 @@
+
+
+ * Ported from OpenAPIValidationTestFive and converted to run on OpenAPI v3.1 + *
+ * The validation tests for Schema in particular are quite different for OpenAPI 3.1 + */ +@RunWith(FATRunner.class) +public class ValidationTestFive { + private static final String SERVER_NAME = "OpenAPIValidationServer"; + + @Server(SERVER_NAME) + public static LibertyServer server; + + @BeforeClass + public static void setup() throws Exception { + WebArchive war = ShrinkWrap.create(WebArchive.class, "validation5.war") + .addAsManifestResource(ValidationTestFive.class.getPackage(), "validation5.yml", "openapi.yml"); + ShrinkHelper.exportDropinAppToServer(server, war, SERVER_ONLY); + + server.startServer(); + } + + @AfterClass + public static void shutdown() throws Exception { + server.stopServer("CWWKO1650E", // Validation errors found + "CWWKO1651W");// Validation warnings found + } + + @Test + public void testTags() throws Exception { + assertMessage(server, "- Message: Required \"name\" field is missing or is set to an invalid value, Location: #/tags"); + } + + @Test + public void testDiscriminator() throws Exception { + assertMessage(server, "- Message: Required \"propertyName\" field is missing or is set to an invalid value,*"); + } + + @Test + public void testSchema() throws Exception { + assertMessage(server, " - Message: The Schema Object must have the \"multipleOf\" property set to a number strictly greater than zero, " + + "Location: #/paths/~1availability/get/parameters/schema"); + assertMessage(server, " - Message: The \"minItems\" property of the Schema Object must be greater than or equal to zero, " + + "Location: #/paths/~1availability/get/parameters/schema"); + assertMessage(server, " - Message: The \"maxItems\" property of the Schema Object must be greater than or equal to zero, " + + "Location: #/paths/~1availability/get/parameters/schema"); + assertMessage(server, " - Message: The \"minProperties\" property of the Schema Object must be greater than or equal to zero, " + + "Location: #/paths/~1availability/get/parameters/schema"); + assertMessage(server, " - Message: The \"maxProperties\" property of the Schema Object must be greater than or equal to zero, " + + "Location: #/paths/~1availability/get/parameters/schema"); + + // Warnings not currently emitted for 3.1 + assertNoMessage(server, " - Message: The \"minItems\" property is not appropriate for the Schema Object of \"object\" type"); + assertNoMessage(server, " - Message: The \"maxItems\" property is not appropriate for the Schema Object of \"object\" type"); + + // Dubious error reported for 3.0, not reported for 3.1 + assertNoMessage(server, " - Message: The Schema Object of \"array\" type must have \"items\" property defined"); + } + +} diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestFour.java b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestFour.java new file mode 100644 index 000000000000..0b2588c1a9b4 --- /dev/null +++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestFour.java @@ -0,0 +1,130 @@ +/******************************************************************************* + * Copyright (c) 2024 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package io.openliberty.microprofile.openapi40.fat.validation; + +import static com.ibm.websphere.simplicity.ShrinkHelper.DeployOptions.SERVER_ONLY; +import static io.openliberty.microprofile.openapi40.fat.validation.ValidationTestUtils.assertMessage; +import static io.openliberty.microprofile.openapi40.fat.validation.ValidationTestUtils.assertNoMessage; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +import com.ibm.websphere.simplicity.ShrinkHelper; + +import componenttest.annotation.Server; +import componenttest.custom.junit.runner.FATRunner; +import componenttest.topology.impl.LibertyServer; + +/** + * Validation tests for References, Callbacks and PathItems + *
+ * Ported from OpenAPIValidationTestFour and converted to run on OpenAPI v3.1
+ */
+@RunWith(FATRunner.class)
+public class ValidationTestFour {
+ private static final String SERVER_NAME = "OpenAPIValidationServer";
+
+ @Server(SERVER_NAME)
+ public static LibertyServer server;
+
+ @BeforeClass
+ public static void setup() throws Exception {
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "validation4.war")
+ .addAsManifestResource(ValidationTestFour.class.getPackage(), "validation4.yml", "openapi.yml");
+ ShrinkHelper.exportDropinAppToServer(server, war, SERVER_ONLY);
+
+ server.startServer();
+ }
+
+ @AfterClass
+ public static void shutdown() throws Exception {
+ server.stopServer("CWWKO1650E", // Validation errors found
+ "CWWKO1651W");// Validation warnings found
+ }
+
+ @Test
+ public void testRef() throws Exception {
+
+ // 3.1 Validation cases
+ // Reference is null/empty (reference is null)
+ // Reference is not a valid URI (URI.create does not parse it) (reference is not a valid URI)
+ // Ref is within components and components is missing (reference not defined within Components)
+ // Ref is to a known name within components and the object is missing (reference not defined within Components)
+ // Ref is to an object but the object is of the wrong type (is an invalid reference) - only reported if no other errors
+
+ // Main differences from 3.0:
+ // We directly test whether the reference parses as a URI
+ // We don't report the "is an invalid reference" error if we report another problem with the same reference
+ // We don't validate references which aren't of the form #/components/
+ * Includes the tests from OpenAPIValidationTestThree, updated for OpenAPI v3.1
+ */
+@RunWith(FATRunner.class)
+public class ValidationTestMissing {
+ private static final String SERVER_NAME = "OpenAPIValidationServer";
+
+ @Server(SERVER_NAME)
+ public static LibertyServer server;
+
+ @BeforeClass
+ public static void setup() throws Exception {
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "validation-missing.war")
+ .addAsManifestResource(ValidationTestMissing.class.getPackage(), "validation-missing.yml", "openapi.yml");
+ ShrinkHelper.exportDropinAppToServer(server, war, SERVER_ONLY);
+
+ server.startServer();
+ }
+
+ @AfterClass
+ public static void shutdown() throws Exception {
+ server.stopServer();
+ }
+
+ @Test
+ public void testEmpty() throws Exception {
+ // Smallrye OpenAPI always generates an empty paths object and a minimal info object if there isn't one present
+ // This is explicitly valid: https://spec.openapis.org/oas/v3.1.0.html#paths-object
+ // This also means we can't actually hit the case where none of paths, components or webhooks are present
+ assertNoMessage(server, "CWWKO1650E"); // Assert no validation errors
+ assertNoMessage(server, "CWWKO1651W"); // Assert no validation warnings
+ }
+
+}
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestNoErrors.java b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestNoErrors.java
new file mode 100644
index 000000000000..9af2e06be2d0
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestNoErrors.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2024 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package io.openliberty.microprofile.openapi40.fat.validation;
+
+import static com.ibm.websphere.simplicity.ShrinkHelper.DeployOptions.SERVER_ONLY;
+import static io.openliberty.microprofile.openapi40.fat.validation.ValidationTestUtils.assertNoMessage;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.ibm.websphere.simplicity.ShrinkHelper;
+
+import componenttest.annotation.Server;
+import componenttest.custom.junit.runner.FATRunner;
+import componenttest.topology.impl.LibertyServer;
+
+@RunWith(FATRunner.class)
+public class ValidationTestNoErrors {
+ private static final String SERVER_NAME = "OpenAPIValidationServer";
+
+ @Server(SERVER_NAME)
+ public static LibertyServer server;
+
+ @BeforeClass
+ public static void setup() throws Exception {
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "validation-noerrors.war")
+ .addAsManifestResource(ValidationTestNoErrors.class.getPackage(), "validation-noerrors.yml", "openapi.yml");
+ ShrinkHelper.exportDropinAppToServer(server, war, SERVER_ONLY);
+
+ server.startServer();
+ }
+
+ @AfterClass
+ public static void shutdown() throws Exception {
+ server.stopServer();
+ }
+
+ @Test
+ public void testNoErrors() throws Exception {
+ assertNoMessage(server, "CWWKO1650E"); // Assert no validation errors
+ assertNoMessage(server, "CWWKO1651W"); // Assert no validation warnings
+ }
+
+}
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestOne.java b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestOne.java
new file mode 100644
index 000000000000..2069bc6eeba3
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestOne.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2024 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package io.openliberty.microprofile.openapi40.fat.validation;
+
+import static com.ibm.websphere.simplicity.ShrinkHelper.DeployOptions.SERVER_ONLY;
+import static io.openliberty.microprofile.openapi40.fat.validation.ValidationTestUtils.assertMessage;
+import static io.openliberty.microprofile.openapi40.fat.validation.ValidationTestUtils.assertNoMessage;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.ibm.websphere.simplicity.ShrinkHelper;
+
+import componenttest.annotation.Server;
+import componenttest.custom.junit.runner.FATRunner;
+import componenttest.topology.impl.LibertyServer;
+import componenttest.topology.utils.FATServletClient;
+
+/**
+ * Does the same validation checks from OpenAPIValidationTestOne but using an OpenAPI 3.1 document
+ *
+ * Covers: Info, Contact, License, ServerVariable(s), Server(s), PathItem, Operation, ExternalDocumentation,
+ * SecurityRequirement, RequestBody, Response, Responses
+ */
+@RunWith(FATRunner.class)
+public class ValidationTestOne extends FATServletClient {
+
+ private static final String SERVER_NAME = "OpenAPIValidationServer";
+
+ @Server(SERVER_NAME)
+ public static LibertyServer server;
+
+ @BeforeClass
+ public static void setup() throws Exception {
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "validation.war")
+ .addAsManifestResource(ValidationTestOne.class.getPackage(), "validation1.yml", "openapi.yml");
+ ShrinkHelper.exportDropinAppToServer(server, war, SERVER_ONLY);
+
+ server.startServer();
+ }
+
+ @AfterClass
+ public static void shutdown() throws Exception {
+ server.stopServer("CWWKO1650E", // Validation errors found
+ "CWWKO1651W");// Validation warnings found
+ }
+
+ @Test
+ public void testErrorAndWarningMessages() throws Exception {
+ assertMessage(server, "CWWKO1650E"); // Validation errors found
+ assertMessage(server, "CWWKO1651W"); // Validation warnings found
+ }
+
+ @Test
+ public void testInfoValidation() throws Exception {
+ assertMessage(server, "Message: The Info Object must contain a valid URL. The \"not in URL format\" value specified for \"termsOfService\"");
+ }
+
+ @Test
+ public void testContactValidation() throws Exception {
+ assertMessage(server, "Message: The Contact Object must contain a valid URL. The \"not in URL Format\" value specified");
+ assertMessage(server, "Message: The Contact Object must contain a valid email address. The \"not an email\" value");
+ }
+
+ @Test
+ public void testServerValidation() throws Exception {
+ assertMessage(server, 4, "Message: The Server Object must contain a valid URL");
+ assertMessage(server, "Message: Required \"url\" field is missing or is set to an invalid value, Location: #/paths/~1reviews/get/servers");
+ assertMessage(server, "The \"extraVariable\" variable in the Server Object is not defined");
+ assertMessage(server, "Message: The \"id\" variable in the Server Object is not defined");
+ }
+
+ @Test
+ public void testServerVariableValidation() throws Exception {
+ assertMessage(server, "Message: Required \"default\" field is missing or is set to an invalid value");
+ }
+
+ @Test
+ public void testPathItemValidation() throws Exception {
+ assertMessage(server,
+ "The \"id\" path parameter from the \"GET\" operation of the path \"/bookings/\\{id\\}\" does not contain the \"required\" field or its value is not \"true\"");
+ assertMessage(server, "The \"GET\" operation of the \"/reviews/\\{id\\}\" path does not define a path parameter that is declared: \"id\"");
+ assertMessage(server,
+ "The Path Item Object must contain a valid path. The \"GET\" operation from the \"/reviews/\\{airline\\}\" path defines a duplicated \"path\" parameter: \"airline\"");
+ assertMessage(server, "The Paths Object contains an invalid path. The \"noSlashPath\" path value does not begin with a slash");
+ assertMessage(server, "The Path Item Object must contain a valid path. The format of the \"/availability/");
+ assertMessage(server, " The \"userFirstName\" path parameter from the \"GET\" operation of the path \"/operationWithParam\" does not contain the \"required\" field");
+ assertMessage(server,
+ "The Path Item Object must contain a valid path. The \"/\\{username\\}\" path defines \"3\" path parameters that are not declared: \"\\[pathWithUndeclaredParams, usernameParam, accountNumber\\]\"");
+ assertMessage(server, "The \"GET\" operation from the \"/operationWithParam\" path defines one path parameter that is not declared: \"\\[userFirstName\\]\"");
+ }
+
+ @Test
+ public void testOperationValidation() throws Exception {
+ // This is no longer an error in OpenAPI 3.1
+ assertNoMessage(server, "Message: Required \"responses\" field is missing or is set to an invalid value, Location: #/paths/~1/get");
+ assertMessage(server, "Message: More than one Operation Objects with \"getReviewById\" value for \"operationId\" field was found. The \"operationId\" must be unique");
+ }
+
+ @Test
+ public void testExternalDocsValidation() throws Exception {
+ assertMessage(server, "Message: The External Documentation Object must contain a valid URL. The \"not a URL\" value");
+ }
+
+ @Test
+ public void testSecurityRequirementValidation() throws Exception {
+ assertMessage(server, "The \"reviewoauth2\" name provided for the Security Requirement Object does not correspond to a declared security scheme");
+ }
+
+ @Test
+ public void testRequestBodyValidation() throws Exception {
+ assertMessage(server, "Message: Required \"content\" field is missing or is set to an invalid value, Location: #/paths/~1reviews/post/requestBody");
+ }
+
+ @Test
+ public void testResponseValidation() throws Exception {
+ assertMessage(server, "Message: Required \"description\" field is missing or is set to an invalid value");
+ }
+
+ @Test
+ public void testResponsesValidation() throws Exception {
+ assertMessage(server, "Message: The Responses Object should contain at least one response code for a successful operation");
+ }
+
+}
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestTwo.java b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestTwo.java
new file mode 100644
index 000000000000..affe3fcbddd7
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestTwo.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2024 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package io.openliberty.microprofile.openapi40.fat.validation;
+
+import static com.ibm.websphere.simplicity.ShrinkHelper.DeployOptions.SERVER_ONLY;
+import static io.openliberty.microprofile.openapi40.fat.validation.ValidationTestUtils.assertMessage;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.ibm.websphere.simplicity.ShrinkHelper;
+
+import componenttest.annotation.Server;
+import componenttest.custom.junit.runner.FATRunner;
+import componenttest.topology.impl.LibertyServer;
+
+/**
+ * Test validation rules for SecurityScheme, SecurityRequirement, OAuthFlow, OAuthFlows, MediaType and Example
+ *
+ * Ported from OpenAPIValidationTestTwo and converted to run on OpenAPI v3.1
+ */
+@RunWith(FATRunner.class)
+public class ValidationTestTwo {
+ private static final String SERVER_NAME = "OpenAPIValidationServer";
+
+ @Server(SERVER_NAME)
+ public static LibertyServer server;
+
+ @BeforeClass
+ public static void setup() throws Exception {
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "validation2.war")
+ .addAsManifestResource(ValidationTestTwo.class.getPackage(), "validation2.yml", "openapi.yml");
+ ShrinkHelper.exportDropinAppToServer(server, war, SERVER_ONLY);
+
+ server.startServer();
+ }
+
+ @AfterClass
+ public static void shutdown() throws Exception {
+ server.stopServer("CWWKO1650E", // Validation errors found
+ "CWWKO1651W");// Validation warnings found
+ }
+
+ @Test
+ public void testSecuritySchemeValidation() throws Exception {
+ assertMessage(server, "Message: Required \"type\" field is missing or is set to an invalid value, Location: #/components/securitySchemes/noType");
+ assertMessage(server, "Message: Required \"openIdConnectUrl\" field is missing or is set to an invalid value,"
+ + " Location: #/components/securitySchemes/openIdConnectWithScheme");
+ assertMessage(server, "Message: Required \"scheme\" field is missing or is set to an invalid value, Location: #/components/securitySchemes/airlinesHttp");
+ assertMessage(server, "Message: Required \"flows\" field is missing or is set to an invalid value, Location: #/components/securitySchemes/reviewoauth2");
+ assertMessage(server, "Message: Required \"scheme\" field is missing or is set to an invalid value, Location: #/components/securitySchemes/httpWithOpenIdConnectUrl");
+ assertMessage(server, "Message: Required \"name\" field is missing or is set to an invalid value, Location: #/components/securitySchemes/ApiKeyWithScheme");
+ assertMessage(server, "Message: Required \"in\" field is missing or is set to an invalid value, Location: #/components/securitySchemes/ApiKeyWithScheme");
+ assertMessage(server, "Message: Required \"in\" field is missing or is set to an invalid value, Location: #/components/securitySchemes/ApiKeyWithInvalidIn");
+ assertMessage(server, "Message: The Security Scheme Object must contain a valid URL. The \"not a URL\" value specified for the URL is not valid*");
+ assertMessage(server, "Message: The \"scheme\" field with \"openIdConnectWithScheme\" value is not applicable for \"Security Scheme Object\" of \"openIdConnect\" type");
+ assertMessage(server, "Message: The \"name\" field with \"oauth2WithName\" value is not applicable for \"Security Scheme Object\" of \"oauth2\" type");
+ assertMessage(server, "Message: The \"openIdConnectUrl\" field with \"http://www.url.com\" value is not applicable for \"Security Scheme Object\" of \"http\" type");
+ assertMessage(server, "Message: The \"flows\" field is not applicable for \"Security Scheme Object\" of \"http\" type");
+ }
+
+ @Test
+ public void testSecurityRequirementValidation() throws Exception {
+ assertMessage(server, "Message: The \"schemeNotInComponent\" name provided for the Security Requirement Object"
+ + " does not correspond to a declared security scheme, Location: #/paths/~1availability/get/security");
+ assertMessage(server, "Message: The \"airlinesHttp\" field of Security Requirement Object should be empty, but is: \"\\[write:app, read:app\\]\"");
+ assertMessage(server, "Message: The \"openIdConnectWithScheme\" Security Requirement Object should specify be a list of scope names required for execution");
+ }
+
+ @Test
+ public void testOAuthFlowValidation() throws Exception {
+ assertMessage(server, 3, "Message: Required \"scopes\" field is missing or is set to an invalid value");
+ assertMessage(server, "Message: The OAuth Flow Object must contain a valid URL. The \"invalid URL example\" value");
+ }
+
+ @Test
+ public void testOAuthFlowsValidation() throws Exception {
+ assertMessage(server, 2, "Message: Required \"tokenUrl\" field is missing or is set to an invalid value");
+ assertMessage(server, "Message: The \"authorizationUrl\" field with \"https://example.com/api/oauth/dialog\" value"
+ + " is not applicable for \"OAuth Flow Object\" of \"password\" type");
+ }
+
+ @Test
+ public void testMediaTypeValidation() throws Exception {
+ assertMessage(server, 2, "Message: The \"nonExistingField\" encoding property specified in the MediaType Object does not exist");
+ assertMessage(server, "Message: The MediaType Object cannot have both \"examples\" and \"example\" fields");
+ assertMessage(server, "Message: The encoding property specified cannot be validated because the corresponding schema property is null");
+ }
+
+ @Test
+ public void testExampleValidation() throws Exception {
+ assertMessage(server, "Message: The \"booking\" Example Object specifies both \"value\" and \"externalValue\" fields");
+ }
+
+}
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestUtils.java b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestUtils.java
new file mode 100644
index 000000000000..cc7d7f59a45e
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/ValidationTestUtils.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2024 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package io.openliberty.microprofile.openapi40.fat.validation;
+
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.junit.Assert.assertThat;
+
+import componenttest.topology.impl.LibertyServer;
+
+/**
+ *
+ */
+public class ValidationTestUtils {
+
+ /**
+ * Assert that a message is found in the messages.log
+ *
+ * @param server the server to check
+ * @param message the message to find
+ */
+ public static void assertMessage(LibertyServer server, String message) throws Exception {
+ assertThat("Message not found: " + message,
+ server.findStringsInLogs(message),
+ not(empty()));
+ }
+
+ /**
+ * Assert that a message is found a specific number of times in the messages.log
+ *
+ * @param server the server to check
+ * @param count the number of times the message is expected
+ * @param message the message to look for
+ */
+ public static void assertMessage(LibertyServer server, int count, String message) throws Exception {
+ assertThat("Message not found " + count + " times: " + message,
+ server.findStringsInLogs(message),
+ hasSize(count));
+ }
+
+ /**
+ * Assert that a message is not found in the messages log
+ *
+ * @param server the server to check
+ * @param message the message to search for
+ */
+ public static void assertNoMessage(LibertyServer server, String message) throws Exception {
+ assertThat("Unexpected message found: " + message,
+ server.findStringsInLogs(message),
+ is(empty()));
+ }
+
+}
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation-missing.yml b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation-missing.yml
new file mode 100644
index 000000000000..b3fc5ca3249a
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation-missing.yml
@@ -0,0 +1,4 @@
+openapi: 3.1.0
+info:
+ version: 0.1
+ title: empty OpenAPI doc
\ No newline at end of file
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation-noerrors.yml b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation-noerrors.yml
new file mode 100644
index 000000000000..cfdfa72feaf3
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation-noerrors.yml
@@ -0,0 +1,554 @@
+openapi: 3.1.0
+info:
+ title: Validation App
+ version: "1.0"
+ termsOfService: http://www.termsofservice.com
+ contact:
+ name: AirlinesRatingApp API Support
+ url: http://www.contacts.com
+ email: airlines@gmail.com
+ license:
+ name: Apache 2.0
+ url: http://www.license.com
+externalDocs:
+ description: instructions for how to deploy this app
+ url: http://www.externaldocumentation.com
+servers:
+- url: http://localhost:9080
+tags:
+- name: Airlines
+ description: airlines app
+- name: airline
+ description: all the airlines methods
+- name: availability
+ description: all the availibility methods
+- name: bookings
+ description: all the bookings methods
+- name: reviews
+ description: all the review methods
+paths:
+ /:
+ get:
+ tags:
+ - airline
+ summary: Retrieve all available airlines
+ responses:
+ 202:
+ description: failed operation
+ content:
+ applictaion/json:
+ schema:
+ $ref: '#/components/schemas/Flight'
+ operationId: getAirlines
+ servers:
+ - url: localhost:9080/oas3-airlines/airlines/id
+ description: view of all the bookings
+ /availability:
+ get:
+ tags:
+ - availability
+ summary: Retrieve all available flights
+ operationId: getFlights
+ parameters:
+ - name: departureDate
+ in: query
+ description: Customer departure date
+ required: true
+ schema:
+ type: string
+ - name: airportFrom
+ in: query
+ description: Airport the customer departs from
+ required: true
+ schema:
+ type: string
+ - name: returningDate
+ in: query
+ description: Customer return date
+ required: true
+ schema:
+ type: string
+ - name: airportTo
+ in: query
+ description: Airport the customer returns to
+ required: true
+ schema:
+ type: string
+ - name: numberOfAdults
+ in: query
+ description: Number of adults on the flight
+ required: true
+ schema:
+ minimum: 0
+ type: string
+ - name: numberOfChildren
+ in: query
+ description: Number of children on the flight
+ required: true
+ schema:
+ minimum: 0
+ type: string
+ responses:
+ 202:
+ description: failed operation
+ content:
+ applictaion/json:
+ schema:
+ $ref: '#/components/schemas/Flight'
+ 404:
+ description: No available flights found
+ content:
+ n/a: {}
+ servers:
+ - url: localhost:9080/oas3-airlines/availability
+ description: view of all the bookings
+ /bookings:
+ get:
+ tags:
+ - bookings
+ summary: Retrieve all bookings for current user
+ operationId: getBookings
+ responses:
+ 200:
+ description: Bookings retrieved
+ content:
+ application/json:
+ schema:
+ type: string
+ 404:
+ description: No bookings found for the user.
+ post:
+ tags:
+ - bookings
+ summary: Create a booking
+ description: Create a new booking record with the booking information provided.
+ operationId: createBooking
+ requestBody:
+ description: Create a new booking with the provided information.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Booking'
+ examples:
+ booking:
+ summary: External booking example
+ externalValue: http://foo.bar/examples/booking-example.json
+ responses:
+ 201:
+ description: Booking created
+ content:
+ application/json:
+ schema:
+ type: string
+ description: id of the new booking
+
+ /bookings/{id}:
+ get:
+ tags:
+ - bookings
+ summary: Get a booking with ID
+ operationId: getBooking
+ parameters:
+ - name: id
+ required: true
+ in: path
+ description: ID of the booking
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: booking retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Booking'
+ 404:
+ description: No bookings found for the user.
+ servers:
+ - url: localhost:9080/oas3-airlines/bookings/{id}
+ description: view of all the bookings for this user
+ variables:
+ id:
+ default: "1"
+ description: id of the review
+ put:
+ tags:
+ - bookings
+ summary: Update a booking with ID
+ operationId: updateBooking
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ schema:
+ type: integer
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Booking'
+ responses:
+ 200:
+ description: Booking updated
+ 404:
+ description: Booking not found
+ delete:
+ tags:
+ - bookings
+ summary: Delete a booking with ID
+ operationId: deleteBooking
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Booking deleted successfully.
+ 404:
+ description: Booking not found.
+ /reviews:
+ get:
+ tags:
+ - reviews
+ summary: get all the reviews
+ operationId: getReview
+ responses:
+ 200:
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ oneOf:
+ - $ref: '#/components/schemas/Review'
+ servers:
+ - url: localhost:9080/oas3-airlines/reviews
+ description: endpoint for all the review related methods
+ post:
+ tags:
+ - reviews
+ summary: Create a Review
+ operationId: createReview
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ description: example review to add
+ required: true
+ responses:
+ 201:
+ description: review created
+ content:
+ application/json:
+ schema:
+ type: string
+ description: id of the new review
+ callbacks:
+ testCallback:
+ http://localhost:9080/oas3-airlines/reviews: {}
+ security:
+ - reviewoauth2:
+ - write:reviews
+ servers:
+ - url: localhost:9080/oas3-airlines/reviews/{id}
+ description: view of all the reviews
+ variables:
+ id:
+ description: id of the review
+ default: "1"
+ /reviews/{id}:
+ get:
+ tags:
+ - reviews
+ summary: Get a review with ID
+ operationId: getReviewById
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Review retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review not found
+ servers:
+ - url: localhost:9080/oas3-airlines/reviews/{id}
+ description: endpoint for all the review related methods
+ variables:
+ id:
+ default: "11"
+ description: id of the review
+ delete:
+ tags:
+ - reviews
+ summary: Delete a Review with ID
+ operationId: deleteReview
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Review deleted
+ 404:
+ description: Review not found
+ /reviews/{user}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews by user
+ operationId: getReviewByUser
+ parameters:
+ - name: user
+ in: path
+ description: username of the user for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ ?
+ : value: bsmith
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ oneOf:
+ - $ref: '#/components/schemas/Review'
+ - $ref: '#/components/schemas/User'
+ discriminator:
+ propertyName: pet_type
+ mapping:
+ review: '#/components/schemas/Review'
+ user: '#/components/schemas/User'
+ 404:
+ description: Review(s) not found
+ /reviews/{airline}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews by airlines
+ operationId: getReviewByAirline
+ parameters:
+ - name: airline
+ in: path
+ description: name of the airlines for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ ?
+ : value: Acme Air
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+ /reviews/{user}/{airlines}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews for an airline by User
+ operationId: getReviewByAirlineAndUser
+ parameters:
+ - name: user
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: airlines
+ in: path
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+components:
+ schemas:
+ User:
+ required:
+ - age
+ - email
+ - firstName
+ - lastName
+ - password
+ - phone
+ - sex
+ type: object
+ properties:
+ password:
+ type: string
+ example: bobSm37
+ firstName:
+ type: string
+ example: Bob
+ lastName:
+ type: string
+ example: Smith
+ sex:
+ type: string
+ example: M
+ age:
+ type: integer
+ example: 37
+ email:
+ type: string
+ example: bob@test.ca
+ phone:
+ type: string
+ example: 123-456-7890
+ id:
+ type: integer
+ username:
+ type: string
+ status:
+ title: User Status
+ type: integer
+ Airline:
+ required:
+ - contactPhone
+ - name
+ type: object
+ properties:
+ name:
+ type: string
+ example: Acme Air
+ contactPhone:
+ type: string
+ example: 1-888-1234-567
+ Flight:
+ required:
+ - airportFrom
+ - airportTo
+ - dateTime
+ - number
+ - price
+ - status
+ type: object
+ properties:
+ airline:
+ $ref: '#/components/schemas/Airline'
+ dateTime:
+ pattern: dateTime
+ type: string
+ example: 2016-03-05 18:00
+ number:
+ type: string
+ example: AC190
+ status:
+ type: string
+ example: On Schedule
+ airportFrom:
+ type: string
+ example: YYZ
+ airportTo:
+ type: string
+ example: LAX
+ price:
+ type: string
+ example: US$350
+ Booking:
+ required:
+ - airMiles
+ - seatPreference
+ type: object
+ properties:
+ departtureFlight:
+ $ref: '#/components/schemas/Flight'
+ returningFlight:
+ $ref: '#/components/schemas/Flight'
+ creditCard:
+ $ref: '#/components/schemas/CreditCard'
+ airMiles:
+ type: string
+ example: 32126319
+ seatPreference:
+ type: string
+ example: window
+ Review:
+ required:
+ - id
+ - rating
+ type: object
+ properties:
+ id:
+ type: string
+ example: 0
+ user:
+ $ref: '#/components/schemas/User'
+ airlines:
+ $ref: '#/components/schemas/Airline'
+ rating:
+ type: integer
+ example: 8
+ comment:
+ type: string
+ example: Great service!
+ CreditCard:
+ required:
+ - cardNumber
+ - cardholderName
+ - cvv
+ - expiryDate
+ - issuer
+ type: object
+ properties:
+ issuer:
+ type: string
+ example: VISA
+ cardholderName:
+ type: string
+ example: Joe Smith
+ cardNumber:
+ type: string
+ example: '**********1234'
+ cvv:
+ type: string
+ example: "0322"
+ expiryDate:
+ type: string
+ example: 04/19
+ securitySchemes:
+ reviewoauth2:
+ type: oauth2
+ description: authentication needed to create and delete reviews
+ flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:reviews: create a review
+
\ No newline at end of file
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation1.yml b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation1.yml
new file mode 100644
index 000000000000..a24a6ba68b41
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation1.yml
@@ -0,0 +1,570 @@
+openapi: 3.1.0
+info:
+ termsOfService: not in URL format
+ contact:
+ name: AirlinesRatingApp API Support
+ url: not in URL Format
+ email: not an email
+ license:
+ url: not in URL format
+externalDocs:
+ description: instructions for how to deploy this app
+ url: not a URL
+servers:
+- url: http://localhost:9080
+tags:
+- name: Airlines
+ description: airlines app
+- name: airline
+ description: all the airlines methods
+- name: availability
+ description: all the availibility methods
+- name: bookings
+ description: all the bookings methods
+- name: reviews
+ description: all the review methods
+paths:
+ noSlashPath:
+ get:
+ summary: A path with no slash
+ operationId: noSlashPath
+ /availability/{us{ser}}:
+ get:
+ summary: Invalid string path
+ /{username}:
+ parameters:
+ - name: pathWithUndeclaredParams
+ description: Path with undecalred parameters
+ in: path
+ schema:
+ type: string
+ required: true
+ - name: usernameParam
+ description: Declared path parameter
+ in: path
+ schema:
+ type: string
+ required: true
+ - name: accountNumber
+ description: Another undeclared path parameter
+ in: path
+ schema:
+ type: string
+ required: true
+ /operationWithParam:
+ get:
+ summary: A get method with path parameter and required set to false
+ parameters:
+ - name: userFirstName
+ description: username parameter
+ in: path
+ schema:
+ type: string
+ required: false
+ /:
+ get:
+ tags:
+ - airline
+ summary: Retrieve all available airlines
+ operationId: getAirlines
+ servers:
+ - url: localhost:9080/oas3-airlines{/}airlines/id
+ description: view of all the bookings
+ /availability:
+ get:
+ tags:
+ - availability
+ summary: Retrieve all available flights
+ operationId: getFlights
+ parameters:
+ - name: departureDate
+ description: Customer departure date
+ required: true
+ schema:
+ type: string
+ - name: airportFrom
+ in: query
+ description: Airport the customer departs from
+ required: true
+ schema:
+ type: string
+ - name: returningDate
+ in: query
+ description: Customer return date
+ required: true
+ schema:
+ type: string
+ - name: airportTo
+ in: query
+ description: Airport the customer returns to
+ required: true
+ schema:
+ type: string
+ - name: numberOfAdults
+ in: query
+ description: Number of adults on the flight
+ required: true
+ schema:
+ minimum: 0
+ type: string
+ - name: numberOfChildren
+ in: query
+ description: Number of children on the flight
+ required: true
+ schema:
+ minimum: 0
+ type: string
+ responses:
+ 402:
+ description: failed operation
+ content:
+ applictaion/json:
+ schema:
+ $ref: '#/components/schemas/Flight'
+ 404:
+ description: No available flights found
+ content:
+ n/a: {}
+ servers:
+ - url: localhost:9080/oas3-airlines{}/availability
+ description: view of all the bookings
+ /bookings:
+ get:
+ tags:
+ - bookings
+ summary: Retrieve all bookings for current user
+ operationId: getBookings
+ responses:
+ 200:
+ description: Bookings retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Booking'
+ 404:
+ description: No bookings found for the user.
+ servers:
+ - url: localhost:9080/oas3-ai{rlines/bookings/
+ description: view of all the bookings for this user
+ variables:
+ id:
+ description: id of the review
+ post:
+ tags:
+ - bookings
+ summary: Create a booking
+ description: Create a new booking record with the booking information provided.
+ operationId: createBooking
+ requestBody:
+ description: Create a new booking with the provided information.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Booking'
+ examples:
+ booking:
+ summary: External booking example
+ externalValue: http://foo.bar/examples/booking-example.json
+ responses:
+ 201:
+ description: Booking created
+ content:
+ application/json:
+ schema:
+ type: string
+ description: id of the new booking
+ callbacks:
+ get all the bookings:
+ http://localhost:9080/airlines/bookings: {}
+ /bookings/{id}:
+ get:
+ tags:
+ - bookings
+ summary: Get a booking with ID
+ operationId: getBooking
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ schema:
+ type: integer
+ responses:
+ 200:
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Booking'
+ 404:
+ description: No bookings found for the user.
+ servers:
+ - url: localhost:9080/}oas3-airlines{/bookings/id
+ description: view of all the bookings
+ put:
+ tags:
+ - bookings
+ summary: Update a booking with ID
+ operationId: updateBooking
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ schema:
+ type: integer
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Booking'
+ responses:
+ 200:
+ description: Booking updated
+ 404:
+ description: Booking not found
+ delete:
+ tags:
+ - bookings
+ summary: Delete a booking with ID
+ operationId: deleteBooking
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Booking deleted successfully.
+ 404:
+ description: Booking not found.
+ /reviews:
+ get:
+ tags:
+ - reviews
+ summary: get all the reviews
+ operationId: getReviewById
+ responses:
+ 200:
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Review'
+ servers:
+ - description: endpoint for all the review related methods
+ post:
+ tags:
+ - reviews
+ summary: Create a Review
+ operationId: createReview
+ requestBody:
+ description: example review to add
+ required: true
+ responses:
+ 201:
+ description: review created
+ content:
+ application/json:
+ schema:
+ type: string
+ description: id of the new review
+ callbacks:
+ testCallback:
+ http://localhost:9080/oas3-airlines/reviews: {}
+ security:
+ - reviewoauth2:
+ - write:reviews
+ - httpTestScheme: []
+ servers:
+ - url: localhost:9080/oas3-airlines/reviews/{id}/{extraVariable}/
+ description: view of all the reviews
+ variables:
+ id:
+ description: id of the review
+ default: "1"
+ '':
+ description: test
+ /reviews/{id}:
+ get:
+ tags:
+ - reviews
+ summary: Get a review with ID
+ operationId: getReviewById
+ parameters:
+ - name: id
+ description: ID of the booking
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Review retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review not found
+ servers:
+ - url: localhost:9080/oas3-airlines/reviews/{id}
+ description: endpoint for all the review related methods
+ delete:
+ tags:
+ - reviews
+ summary: Delete a Review with ID
+ operationId: deleteReview
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Review deleted
+ 404:
+ description: Review not found
+ /reviews/{user}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews by user
+ operationId: getReviewByUser
+ parameters:
+ - name: user
+ in: path
+ description: username of the user for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ ?
+ : value: bsmith
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+ /reviews/{airline}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews by airlines
+ operationId: getReviewByAirline
+ parameters:
+ - name: airline
+ in: path
+ description: name of the airlines for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ ?
+ : value: Acme Air
+ - name: airline
+ in: path
+ description: name of the airlines for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ ?
+ : value: Acme Air
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+ /reviews/{user}/{airlines}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews for an airline by User
+ operationId: getReviewByAirlineAndUser
+ parameters:
+ - name: user
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: airlines
+ in: path
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+components:
+ schemas:
+ User:
+ required:
+ - age
+ - email
+ - firstName
+ - lastName
+ - password
+ - phone
+ - sex
+ type: object
+ properties:
+ password:
+ type: string
+ examples: [bobSm37]
+ firstName:
+ type: string
+ example: Bob
+ lastName:
+ type: string
+ example: Smith
+ sex:
+ type: string
+ example: M
+ age:
+ type: integer
+ example: 37
+ email:
+ type: string
+ example: bob@test.ca
+ phone:
+ type: string
+ example: 123-456-7890
+ id:
+ type: integer
+ username:
+ type: string
+ status:
+ title: User Status
+ type: integer
+ Airline:
+ required:
+ - contactPhone
+ - name
+ type: object
+ properties:
+ name:
+ type: string
+ example: Acme Air
+ contactPhone:
+ type: string
+ example: 1-888-1234-567
+ Flight:
+ required:
+ - airportFrom
+ - airportTo
+ - dateTime
+ - number
+ - price
+ - status
+ type: object
+ properties:
+ airline:
+ $ref: '#/components/schemas/Airline'
+ dateTime:
+ pattern: dateTime
+ type: string
+ example: 2016-03-05 18:00
+ number:
+ type: string
+ example: AC190
+ status:
+ type: string
+ example: On Schedule
+ airportFrom:
+ type: string
+ example: YYZ
+ airportTo:
+ type: string
+ example: LAX
+ price:
+ type: string
+ example: US$350
+ Booking:
+ required:
+ - airMiles
+ - seatPreference
+ type: object
+ properties:
+ departtureFlight:
+ $ref: '#/components/schemas/Flight'
+ returningFlight:
+ $ref: '#/components/schemas/Flight'
+ creditCard:
+ $ref: '#/components/schemas/CreditCard'
+ airMiles:
+ type: string
+ example: 32126319
+ seatPreference:
+ type: string
+ example: window
+ Review:
+ required:
+ - id
+ - rating
+ type: object
+ properties:
+ id:
+ type: string
+ example: 0
+ user:
+ $ref: '#/components/schemas/User'
+ airlines:
+ $ref: '#/components/schemas/Airline'
+ rating:
+ type: integer
+ example: 8
+ comment:
+ type: string
+ example: Great service!
+ CreditCard:
+ required:
+ - cardNumber
+ - cardholderName
+ - cvv
+ - expiryDate
+ - issuer
+ type: object
+ properties:
+ issuer:
+ type: string
+ example: VISA
+ cardholderName:
+ type: string
+ example: Joe Smith
+ cardNumber:
+ type: string
+ example: '**********1234'
+ cvv:
+ type: string
+ example: "0322"
+ expiryDate:
+ type: string
+ example: 04/19
\ No newline at end of file
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation2.yml b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation2.yml
new file mode 100644
index 000000000000..d1fd869ffb4a
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation2.yml
@@ -0,0 +1,645 @@
+openapi: 3.1.0
+info:
+ title: "Validation App"
+ version: "1.0"
+ termsOfService: http://www.termsofservice.com/terms
+ contact:
+ name: AirlinesRatingApp API Support
+ url: https://github.com/microservices-api/oas3-airlines
+ license:
+ name: Apache 2.0
+ url: http://www.apache.org/licenses/LICENSE-2.0.html
+externalDocs:
+ description: instructions for how to deploy this app
+servers:
+- url: http://localhost:9080
+tags:
+- name: Airlines
+ description: airlines app
+- name: airline
+ description: all the airlines methods
+- name: availability
+ description: all the availibility methods
+- name: bookings
+ description: all the bookings methods
+- name: reviews
+ description: all the review methods
+paths:
+ /:
+ get:
+ tags:
+ - airline
+ summary: Retrieve all available airlines
+ operationId: getAirlines
+ responses:
+ 200:
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Airline'
+ 404:
+ description: No airlines found
+ content:
+ n/a: {}
+ servers:
+ - url: localhost:9080/oas3-airlines/airlines/id
+ description: view of all the bookings
+ /availability:
+ get:
+ tags:
+ - availability
+ summary: Retrieve all available flights
+ operationId: getFlights
+ parameters:
+ - name: departureDate
+ in: query
+ description: Customer departure date
+ required: true
+ schema:
+ type: string
+ - name: airportFrom
+ in: query
+ description: Airport the customer departs from
+ required: true
+ schema:
+ type: string
+ - name: returningDate
+ in: query
+ description: Customer return date
+ required: true
+ schema:
+ type: string
+ - name: airportTo
+ in: query
+ description: Airport the customer returns to
+ required: true
+ schema:
+ type: string
+ - name: numberOfAdults
+ in: query
+ description: Number of adults on the flight
+ required: true
+ schema:
+ minimum: 0
+ type: string
+ - name: numberOfChildren
+ in: query
+ description: Number of children on the flight
+ required: true
+ schema:
+ minimum: 0
+ type: string
+ responses:
+ 200:
+ description: successful operation
+ content:
+ applictaion/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Flight'
+ 404:
+ description: No available flights found
+ content:
+ n/a: {}
+ security:
+ - schemeNotInComponent: []
+ - airlinesHttp:
+ - write:app
+ - read:app
+ - openIdConnectWithScheme: []
+ /bookings:
+ get:
+ tags:
+ - bookings
+ summary: Retrieve all bookings for current user
+ operationId: getBookings
+ security:
+ nullScheme: []
+ responses:
+ 200:
+ description: Bookings retrieved
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - airMiles
+ - seatPreference
+ properties:
+ departtureFlight:
+ $ref: '#/components/schemas/Flight'
+ returningFlight:
+ $ref: '#/components/schemas/Flight'
+ creditCard:
+ $ref: '#/components/schemas/CreditCard'
+ airMiles:
+ type: string
+ example: 32126319
+ seatPreference:
+ type: string
+ example: window
+ encoding:
+ airMiles:
+ contentType: text/plain
+ nonExistingField:
+ contentType: text/plain
+ examples:
+ booking:
+ summary: External booking example
+ value: http://foo.bar/examples/booking-example.json
+ example:
+ booking:
+ summary: booking example
+ value: http://foo.bar/examples/booking-example.json
+ 404:
+ description: No bookings found for the user.
+ servers:
+ - url: localhost:9080/oas3-airlines/bookings/{id}
+ description: view of all the bookings for this user
+ variables:
+ id:
+ description: id of the review
+ default: "1"
+ post:
+ tags:
+ - bookings
+ summary: Create a booking
+ description: Create a new booking record with the booking information provided.
+ operationId: createBooking
+ requestBody:
+ description: Create a new booking with the provided information.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Booking'
+ encoding:
+ airMiles:
+ contentType: text/plain
+ nonExistingField:
+ contentType: text/plain
+ examples:
+ booking:
+ summary: External booking example
+ value: http://foo.bar/examples/booking-example.json
+ externalValue: http://foo.bar/examples/booking-example.json
+ responses:
+ 201:
+ description: Booking created
+ content:
+ application/json:
+ schema:
+ type: string
+ description: id of the new booking
+ security:
+ callbacks:
+ get all the bookings:
+ http://localhost:9080/airlines/bookings: {}
+ /bookings/{id}:
+ get:
+ tags:
+ - bookings
+ summary: Get a booking with ID
+ operationId: getBooking
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Bookings retrieved
+ content:
+ application/json:
+ schema:
+ '': ''
+ encoding:
+ airMiles:
+ contentType: text/plain
+ nonExistingField:
+ contentType: text/plain
+ 404:
+ description: No bookings found for the user.
+ servers:
+ - url: localhost:9080/oas3-airlines/bookings/id
+ description: view of all the bookings
+ put:
+ tags:
+ - bookings
+ summary: Update a booking with ID
+ operationId: updateBooking
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ schema:
+ type: integer
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Booking'
+ responses:
+ 200:
+ description: Booking updated
+ 404:
+ description: Booking not found
+ delete:
+ tags:
+ - bookings
+ summary: Delete a booking with ID
+ operationId: deleteBooking
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Booking deleted successfully.
+ 404:
+ description: Booking not found.
+ /reviews:
+ get:
+ tags: []
+ summary: get all the reviews
+ operationId: getAllReviews
+ responses:
+ 200:
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Review'
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+ post:
+ tags: []
+ summary: Create a Review
+ operationId: createReview
+ requestBody:
+ description: example review to add
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ examples:
+ review:
+ summary: External review example
+ externalValue: http://foo.bar/examples/review-example.json
+ required: true
+ responses:
+ 201:
+ description: review created
+ content:
+ application/json:
+ schema:
+ type: string
+ description: id of the new review
+ callbacks:
+ testCallback:
+ http://localhost:9080/oas3-airlines/reviews: {}
+ security:
+ - reviewoauth2:
+ - write:reviews
+ servers:
+ - url: localhost:9080/oas3-airlines/reviews/{id}
+ description: view of all the reviews
+ variables:
+ id:
+ description: id of the review
+ default: "1"
+ /reviews/{id}:
+ get:
+ tags: []
+ summary: Get a review with ID
+ operationId: getReviewById
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: integer
+ examples:
+ id:
+ value: 1
+ responses:
+ 200:
+ description: Review retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review not found
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+ delete:
+ tags: []
+ summary: Delete a Review with ID
+ operationId: deleteReview
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Review deleted
+ 404:
+ description: Review not found
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+ /reviews/{user}:
+ get:
+ tags: []
+ summary: Get all reviews by user
+ operationId: getReviewByUser
+ parameters:
+ - name: user
+ in: path
+ description: username of the user for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ user:
+ value: bsmith
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+ /reviews/{airline}:
+ get:
+ tags: []
+ summary: Get all reviews by airlines
+ operationId: getReviewByAirline
+ parameters:
+ - name: airline
+ in: path
+ description: name of the airlines for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ airline:
+ value: Acme Air
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+ /reviews/{user}/{airlines}:
+ get:
+ tags: []
+ summary: Get all reviews for an airline by User
+ operationId: getReviewByAirlineAndUser
+ parameters:
+ - name: user
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: airlines
+ in: path
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+components:
+ schemas:
+ User:
+ required:
+ - age
+ - email
+ - firstName
+ - lastName
+ - password
+ - phone
+ - sex
+ type: object
+ properties:
+ password:
+ type: string
+ example: bobSm37
+ firstName:
+ type: string
+ example: Bob
+ lastName:
+ type: string
+ example: Smith
+ sex:
+ type: string
+ example: M
+ age:
+ type: integer
+ example: 37
+ email:
+ type: string
+ example: bob@test.ca
+ phone:
+ type: string
+ example: 123-456-7890
+ id:
+ type: integer
+ username:
+ type: string
+ status:
+ title: User Status
+ type: integer
+ Airline:
+ required:
+ - contactPhone
+ - name
+ type: object
+ properties:
+ name:
+ type: string
+ example: Acme Air
+ contactPhone:
+ type: string
+ example: 1-888-1234-567
+ Flight:
+ required:
+ - airportFrom
+ - airportTo
+ - dateTime
+ - number
+ - price
+ - status
+ type: object
+ properties:
+ airline:
+ $ref: '#/components/schemas/Airline'
+ dateTime:
+ pattern: dateTime
+ type: string
+ example: 2016-03-05 18:00
+ number:
+ type: string
+ example: AC190
+ status:
+ type: string
+ example: On Schedule
+ airportFrom:
+ type: string
+ example: YYZ
+ airportTo:
+ type: string
+ example: LAX
+ price:
+ type: string
+ example: US$350
+ Booking:
+ required:
+ - airMiles
+ - seatPreference
+ type: object
+ properties:
+ departtureFlight:
+ $ref: '#/components/schemas/Flight'
+ returningFlight:
+ $ref: '#/components/schemas/Flight'
+ creditCard:
+ $ref: '#/components/schemas/CreditCard'
+ airMiles:
+ type: string
+ example: 32126319
+ seatPreference:
+ type: string
+ example: window
+ Review:
+ required:
+ - id
+ - rating
+ type: object
+ properties:
+ id:
+ type: string
+ example: 0
+ user:
+ $ref: '#/components/schemas/User'
+ airlines:
+ $ref: '#/components/schemas/Airline'
+ rating:
+ type: integer
+ example: 8
+ comment:
+ type: string
+ example: Great service!
+ CreditCard:
+ required:
+ - cardNumber
+ - cardholderName
+ - cvv
+ - expiryDate
+ - issuer
+ type: object
+ properties:
+ issuer:
+ type: string
+ example: VISA
+ cardholderName:
+ type: string
+ example: Joe Smith
+ cardNumber:
+ type: string
+ example: '**********1234'
+ cvv:
+ type: string
+ example: "0322"
+ expiryDate:
+ type: string
+ example: 04/19
+ securitySchemes:
+ nullScheme:
+ null
+ noType:
+ description: authentication to view availabilities
+ openIdConnectWithScheme:
+ type: openIdConnect
+ description: authentication needed to view all the airlines
+ scheme: openIdConnectWithScheme
+ airlinesHttp:
+ type: http
+ description: authentication needed to view all the airlines
+ reviewoauth2:
+ type: oauth2
+ description: authentication needed to create and delete reviews
+ name: oauth2WithName
+ availabilityApiKey:
+ type: openIdConnect
+ description: authentication to view availabilities
+ openIdConnectUrl: not a URL
+ httpWithOpenIdConnectUrl:
+ type: http
+ flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:reviews: create a review
+ authorizationCode:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ tokenUrl: https://example.com/api/oauth/token
+ password:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ clientCredentials:
+ refreshUrl: invalid URL example
+ openIdConnectUrl: http://www.url.com
+ availabilityOpenIdConnect:
+ type: openIdConnect
+ description: authentication to view availabilities
+ ApiKeyWithScheme:
+ type: apiKey
+ description: authentication needed to view all the airlines
+ ApiKeyWithInvalidIn:
+ type: apiKey
+ name: myApiKey
+ in: path
+ description: authentication needed to view all the airlines
\ No newline at end of file
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation4.yml b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation4.yml
new file mode 100644
index 000000000000..fc3a198033b6
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation4.yml
@@ -0,0 +1,690 @@
+openapi: 3.1.0
+info:
+ title: validation
+ version: "1.0"
+ termsOfService: http://www.termsofservice.com/terms
+ contact:
+ name: AirlinesRatingApp API Support
+ url: https://github.com/microservices-api/oas3-airlines
+ license:
+ name: Apache 2.0
+ url: http://www.apache.org/licenses/LICENSE-2.0.html
+externalDocs:
+ description: instructions for how to deploy this app
+ url: https://github.com/microservices-api/oas3-airlines
+servers:
+- url: http://localhost:9080
+tags:
+- name: Airlines
+ description: airlines app
+- name: airline
+ description: all the airlines methods
+- name: availability
+ description: all the availibility methods
+- name: bookings
+ description: all the bookings methods
+- name: reviews
+ description: all the review methods
+paths:
+ /:
+ get:
+ tags:
+ - airline
+ summary: Retrieve all available airlines
+ operationId: getAirlines
+ responses:
+ 200:
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/invalidRef/schemas/testSchema'
+ 404:
+ description: No airlines found
+ content:
+ n/a: {}
+ servers:
+ - url: localhost:9080/oas3-airlines/airlines/id
+ description: view of all the bookings
+ /availability:
+ get:
+ tags:
+ - availability
+ summary: Retrieve all available flights
+ operationId: getFlights
+ parameters:
+ - name: departureDate
+ in: query
+ description: Customer departure date
+ required: true
+ schema:
+ type: object
+ $ref: "#/components/components/schemas/Date"
+ - name: airportFrom
+ in: query
+ description: Airport the customer departs from
+ required: true
+ schema:
+ type: object
+ $ref: ""
+ - name: returningDate
+ in: query
+ description: Customer return date
+ required: true
+ schema:
+ type: object
+ $ref: " "
+ - name: airportTo
+ in: query
+ description: Airport the customer returns to
+ required: true
+ schema:
+ type: object
+ $ref: "#/components/schemas/Airport/Cat"
+ - name: numberOfAdults
+ in: query
+ description: Number of adults on the flight
+ required: true
+ schema:
+ minimum: 0
+ type: object
+ $ref: "#"
+ - name: numberOfChildren
+ in: query
+ description: Number of children on the flight
+ required: true
+ schema:
+ minimum: 0
+ type: object
+ $ref: "#/"
+ - $ref: '#/components/schemas/Flight'
+ - $ref: http://{}/#/test
+ - $ref: '#/components/schemas'
+ responses:
+ 200:
+ description: successful operation
+ content:
+ applictaion/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/Flight'
+ headers:
+ X-Rate-Limit-Limit:
+ name: x
+ in: header
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+ 404:
+ description: No available flights found
+ content:
+ n/a: {}
+ /bookings:
+ get:
+ tags:
+ - bookings
+ summary: Retrieve all bookings for current user
+ operationId: getBookings
+ responses:
+ 200:
+ description: Bookings retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components//Booking'
+ 404:
+ description: No bookings found for the user.
+ servers:
+ - url: localhost:9080/oas3-airlines/bookings/{id}
+ description: view of all the bookings for this user
+ variables:
+ id:
+ description: id of the review
+ default: "1"
+ post:
+ tags:
+ - bookings
+ summary: Create a booking
+ description: Create a new booking record with the booking information provided.
+ operationId: createBooking
+ requestBody:
+ $ref: "#/components/requestBodies/Pet"
+ responses:
+ 201:
+ description: Booking created
+ content:
+ application/json:
+ schema:
+ type: string
+ description: id of the new booking
+ callbacks:
+ getBookings:
+ ?
+ :
+ get:
+ summary: Retrieve all bookings for current user
+ operationId: getBookings3
+ responses:
+ 200:
+ description: Bookings retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas'
+ 404:
+ description: No bookings found for the user.
+ /bookings/{id}:
+ get:
+ tags:
+ - bookings
+ summary: Get a booking with ID
+ operationId: getBooking
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Bookings retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/schemas'
+ headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ in: header
+ name: X-Rate-Limit-Limit
+ schema:
+ type: integer
+
+ 404:
+ description: No bookings found for the user.
+ servers:
+ - url: localhost:9080/oas3-airlines/bookings/id
+ description: view of all the bookings
+ put:
+ tags:
+ - bookings
+ summary: Update a booking with ID
+ operationId: updateBooking
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ schema:
+ type: integer
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ responses:
+ 200:
+ description: Booking updated
+ 404:
+ description: Booking not found
+ callbacks:
+ testCallback:
+ h://localhost:9080/oas3-airlines/booking:
+ get:
+ summary: Retrieve all bookings for current user
+ operationId: getBookings1
+ responses:
+ 200:
+ description: Bookings retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Booking'
+ 404:
+ description: No bookings found for the user.
+ delete:
+ tags:
+ - bookings
+ summary: Delete a booking with ID
+ operationId: deleteBooking
+ parameters:
+ - name: id
+ responses:
+ 200:
+ $ref: "#/components/responses/Pet"
+ 404:
+ description: Booking not found.
+ callbacks:
+ testCallback:
+ http://localhost:9080/o{as3-ai{rl}ines/booking:
+ get:
+ summary: Retrieve all bookings for current user
+ operationId: getBookings2
+ responses:
+ 200:
+ description: Bookings retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Booking'
+ 404:
+ description: No bookings found for the user.
+ /reviews:
+ get:
+ tags:
+ - reviews
+ summary: get all the reviews
+ operationId: getAllReviews
+ responses:
+ 200:
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Review'
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+ post:
+ tags:
+ - reviews
+ summary: Create a Review
+ operationId: createReview
+ requestBody:
+ description: example review to add
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ examples:
+ review:
+ $ref: "#/components/examples/Pet"
+ required: true
+ responses:
+ 201:
+ description: review created
+ content:
+ application/json:
+ schema:
+ type: string
+ description: id of the new review
+ callbacks:
+ testCallback:
+ http://localhost:9080/oas3-airlines/reviews: {}
+ security:
+ - reviewoauth2:
+ - write:reviews
+ servers:
+ - url: localhost:9080/oas3-airlines/reviews/{id}
+ description: view of all the reviews
+ variables:
+ id:
+ description: id of the review
+ default: "1"
+ put:
+ tags:
+ - reviews
+ summary: Update a review with ID
+ operationId: updateReview
+ parameters:
+ - name: id
+ in: path
+ description: ID of the review
+ required: true
+ schema:
+ type: integer
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ links:
+ review:
+ operationRef: "#/paths/reviews/get"
+ operationId: getUserREview
+ parameters:
+ userId: $request.path.id
+ responses:
+ 200:
+ description: Review updated
+ 404:
+ description: Review not found
+ callbacks:
+ testCallback:
+ http://abc.com/path/{$url}/version/{$method}/root/{$statusCodeXXX}/path:
+ get:
+ summary: Retrieve all reviews for current user
+ operationId: getReviews
+ responses:
+ 200:
+ description: Rview retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: No bookings found for the user.
+ /reviews/{id}:
+ get:
+ tags:
+ - reviews
+ summary: Get a review with ID
+ operationId: getReviewById
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: integer
+ examples:
+ id:
+ value: 1
+ responses:
+ 200:
+ description: Review retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review not found
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+ delete:
+ tags:
+ - reviews
+ summary: Delete a Review with ID
+ operationId: deleteReview
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Review deleted
+ 404:
+ description: Review not found
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+ /reviews/{user}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews by user
+ operationId: getReviewByUser
+ parameters:
+ - name: user
+ in: path
+ description: username of the user for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ user:
+ value: bsmith
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+ /reviews/{airline}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews by airlines
+ operationId: getReviewByAirline
+ parameters:
+ - name: airline
+ in: path
+ description: name of the airlines for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ airline:
+ value: Acme Air
+ - name: airline
+ in: path
+ description: name of the airlines for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ airline:
+ value: Acme Air
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+ /reviews/{user}/{airlines}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews for an airline by User
+ operationId: getReviewByAirlineAndUser
+ parameters:
+ - name: user
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: airlines
+ in: path
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+ servers:
+ - url: http://localhost:9080/airlines/reviews/
+ description: endpoint for all the review related methods
+components:
+ schemas:
+ User:
+ required:
+ - age
+ - email
+ - firstName
+ - lastName
+ - password
+ - phone
+ - sex
+ type: object
+ properties:
+ password:
+ type: string
+ example: bobSm37
+ firstName:
+ type: string
+ example: Bob
+ lastName:
+ type: string
+ example: Smith
+ sex:
+ type: string
+ example: M
+ age:
+ type: integer
+ example: 37
+ email:
+ type: string
+ example: bob@test.ca
+ phone:
+ type: string
+ example: 123-456-7890
+ id:
+ type: integer
+ username:
+ type: string
+ status:
+ title: User Status
+ type: integer
+ Airline:
+ required:
+ - contactPhone
+ - name
+ type: object
+ properties:
+ name:
+ type: string
+ example: Acme Air
+ contactPhone:
+ type: string
+ example: 1-888-1234-567
+ Flight:
+ required:
+ - airportFrom
+ - airportTo
+ - dateTime
+ - number
+ - price
+ - status
+ type: object
+ properties:
+ airline:
+ $ref: '#/components/schemas/Airline'
+ dateTime:
+ pattern: dateTime
+ type: string
+ example: 2016-03-05 18:00
+ number:
+ type: string
+ example: AC190
+ status:
+ type: string
+ example: On Schedule
+ airportFrom:
+ type: string
+ example: YYZ
+ airportTo:
+ type: string
+ example: LAX
+ price:
+ type: string
+ example: US$350
+ Booking:
+ required:
+ - airMiles
+ - seatPreference
+ type: object
+ properties:
+ departtureFlight:
+ $ref: '#/components/schemas/Flight'
+ returningFlight:
+ $ref: '#/components/schemas/Flight'
+ creditCard:
+ $ref: '#/components/schemas/CreditCard'
+ airMiles:
+ type: string
+ example: 32126319
+ seatPreference:
+ type: string
+ example: window
+ Review:
+ required:
+ - id
+ - rating
+ type: object
+ properties:
+ id:
+ type: string
+ example: 0
+ user:
+ $ref: '#/components/schemas/User'
+ airlines:
+ $ref: '#/components/schemas/Airline'
+ rating:
+ type: integer
+ example: 8
+ comment:
+ type: string
+ example: Great service!
+ CreditCard:
+ required:
+ - cardNumber
+ - cardholderName
+ - cvv
+ - expiryDate
+ - issuer
+ type: object
+ properties:
+ issuer:
+ type: string
+ example: VISA
+ cardholderName:
+ type: string
+ example: Joe Smith
+ cardNumber:
+ type: string
+ example: '**********1234'
+ cvv:
+ type: string
+ example: "0322"
+ expiryDate:
+ type: string
+ example: 04/19
+ securitySchemes:
+ reviewoauth2:
+ type: oauth2
+ description: authentication needed to create and delete reviews
+ flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:reviews: create a review
+ authorizationCode:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ tokenUrl: https://example.com/api/oauth/token
\ No newline at end of file
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation5.yml b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation5.yml
new file mode 100644
index 000000000000..8519d4cee39d
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation5.yml
@@ -0,0 +1,590 @@
+openapi: 3.1.0
+info:
+ title: Validation App
+ version: 1.0
+ termsOfService: http://www.termsofservice.com
+ contact:
+ name: AirlinesRatingApp API Support
+ url: http://www.contacts.com
+ email: airlines@gmail.com
+ license:
+ name: Apache 2.0
+ url: http://www.license.com
+externalDocs:
+ description: instructions for how to deploy this app
+ url: http://www.externaldocumentation.com
+servers:
+- url: http://localhost:9080
+tags:
+- description: airlines app
+- name: airline
+ description: all the airlines methods
+- name: availability
+ description: all the availibility methods
+- name: bookings
+ description: all the bookings methods
+- name: reviews
+ description: all the review methods
+paths:
+ /:
+ get:
+ tags:
+ - airline
+ summary: Retrieve all available airlines
+ responses:
+ 202:
+ description: failed operation
+ content:
+ applictaion/json:
+ schema:
+ $ref: '#/components/schemas/Flight'
+ operationId: getAirlines
+ servers:
+ - url: localhost:9080/oas3-airlines/airlines/id
+ description: view of all the bookings
+ /availability:
+ get:
+ tags:
+ - availability
+ summary: Retrieve all available flights
+ operationId: getFlights
+ parameters:
+ - name: departureDate
+ description: Customer departure date
+ required: true
+ schema:
+ type: string
+ readOnly: true
+ writeOnly: true
+ uniqueItems: true
+ maxLength: -1
+ minLength: -3
+ - name: airportFrom
+ in: query
+ description: Airport the customer departs from
+ required: true
+ schema:
+ type: array
+ maxItems: -2
+ minItems: -3
+ multipleOf: 0
+ - name: returningDate
+ in: query
+ description: Customer return date
+ required: true
+ schema:
+ type: object
+ minItems: 1
+ maxItems: 5
+ minProperties: -3
+ maxProperties: -5
+ - name: airportTo
+ in: query
+ description: Airport the customer returns to
+ required: true
+ schema:
+ type: string
+ - name: numberOfAdults
+ in: query
+ description: Number of adults on the flight
+ required: true
+ schema:
+ minimum: 0
+ type: string
+ - name: numberOfChildren
+ in: query
+ description: Number of children on the flight
+ required: true
+ schema:
+ minimum: 0
+ type: string
+ responses:
+ 202:
+ description: failed operation
+ content:
+ applictaion/json:
+ schema:
+ $ref: '#/components/schemas/Flight'
+ 404:
+ description: No available flights found
+ content:
+ n/a: {}
+ servers:
+ - url: localhost:9080/oas3-airlines/availability
+ description: view of all the bookings
+ /bookings:
+ get:
+ tags:
+ - bookings
+ summary: Retrieve all bookings for current user
+ operationId: getBookings
+ responses:
+ 200:
+ description: Bookings retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ 404:
+ description: No bookings found for the user.
+ post:
+ tags:
+ - bookings
+ summary: Create a booking
+ description: Create a new booking record with the booking information provided.
+ operationId: createBooking
+ requestBody:
+ description: Create a new booking with the provided information.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Booking'
+ examples:
+ booking:
+ summary: External booking example
+ externalValue: http://foo.bar/examples/booking-example.json
+ responses:
+ 201:
+ description: Booking created
+ content:
+ application/json:
+ schema:
+ type: string
+ description: id of the new booking
+ callbacks:
+ get all the bookings:
+ http://localhost:9080/airlines/bookings:
+ get:
+ tags:
+ - bookings
+ summary: Get a booking with ID
+ operationId: getBookingCallback
+ extensions:
+ - name: 'invalidExtensionVal'
+ value: true
+ parameters:
+ - name: id
+ required: true
+ in: query
+ description: ID of the booking
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: booking retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Booking'
+ 404:
+ description: No bookings found for the user.
+ /bookings/{id}:
+ get:
+ tags:
+ - bookings
+ summary: Get a booking with ID
+ operationId: getBooking
+ parameters:
+ - name: id
+ required: true
+ in: path
+ description: ID of the booking
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: booking retrieved
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Booking'
+ 404:
+ description: No bookings found for the user.
+ servers:
+ - url: localhost:9080/oas3-airlines/bookings/{id}
+ description: view of all the bookings for this user
+ variables:
+ id:
+ default: "1"
+ description: id of the review
+ put:
+ tags:
+ - bookings
+ summary: Update a booking with ID
+ operationId: updateBooking
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ schema:
+ type: integer
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Booking'
+ responses:
+ 200:
+ description: Booking updated
+ 404:
+ description: Booking not found
+ delete:
+ tags:
+ - bookings
+ summary: Delete a booking with ID
+ operationId: deleteBooking
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Booking deleted successfully.
+ 404:
+ description: Booking not found.
+ /reviews:
+ get:
+ tags:
+ - reviews
+ summary: get all the reviews
+ operationId: getReview
+ responses:
+ 200:
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Review'
+ servers:
+ - url: localhost:9080/oas3-airlines/reviews
+ description: endpoint for all the review related methods
+ post:
+ tags:
+ - reviews
+ summary: Create a Review
+ operationId: createReview
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ description: example review to add
+ required: true
+ responses:
+ 201:
+ description: review created
+ content:
+ application/json:
+ schema:
+ type: string
+ description: id of the new review
+ callbacks:
+ testCallback:
+ http://localhost:9080/oas3-airlines/reviews: {}
+ security:
+ - reviewoauth2:
+ - write:reviews
+ servers:
+ - url: localhost:9080/oas3-airlines/reviews/{id}
+ description: view of all the reviews
+ variables:
+ id:
+ description: id of the review
+ default: "1"
+ /reviews/{id}:
+ get:
+ tags:
+ - reviews
+ summary: Get a review with ID
+ operationId: getReviewById
+ parameters:
+ - name: id
+ in: path
+ description: ID of the booking
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Review retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review not found
+ servers:
+ - url: localhost:9080/oas3-airlines/reviews/{id}
+ description: endpoint for all the review related methods
+ variables:
+ id:
+ default: "11"
+ description: id of the review
+ delete:
+ tags:
+ - reviews
+ summary: Delete a Review with ID
+ operationId: deleteReview
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: integer
+ responses:
+ 200:
+ description: Review deleted
+ 404:
+ description: Review not found
+ /reviews/{user}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews by user
+ operationId: getReviewByUser
+ parameters:
+ - name: user
+ in: path
+ description: username of the user for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ ?
+ : value: bsmith
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ oneOf:
+ - $ref: '#/components/schemas/Review'
+ - $ref: '#/components/schemas/User'
+ discriminator:
+ mapping:
+ review: '#/components/schemas/Review'
+ user: '#/components/schemas/User'
+ 404:
+ description: Review(s) not found
+ /reviews/{airline}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews by airlines
+ operationId: getReviewByAirline
+ parameters:
+ - name: airline
+ in: path
+ description: name of the airlines for the reviews
+ required: true
+ content:
+ '*/*':
+ schema:
+ type: string
+ examples:
+ ?
+ : value: Acme Air
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+ /reviews/{user}/{airlines}:
+ get:
+ tags:
+ - reviews
+ summary: Get all reviews for an airline by User
+ operationId: getReviewByAirlineAndUser
+ parameters:
+ - name: user
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: airlines
+ in: path
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Review(s) retrieved
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Review'
+ 404:
+ description: Review(s) not found
+components:
+ schemas:
+ User:
+ required:
+ - age
+ - email
+ - firstName
+ - lastName
+ - password
+ - phone
+ - sex
+ type: object
+ properties:
+ password:
+ type: string
+ example: bobSm37
+ firstName:
+ type: string
+ example: Bob
+ lastName:
+ type: string
+ example: Smith
+ sex:
+ type: string
+ example: M
+ age:
+ type: integer
+ example: 37
+ email:
+ type: string
+ example: bob@test.ca
+ phone:
+ type: string
+ example: 123-456-7890
+ id:
+ type: integer
+ username:
+ type: string
+ status:
+ title: User Status
+ type: integer
+ Airline:
+ required:
+ - contactPhone
+ - name
+ type: object
+ properties:
+ name:
+ type: string
+ example: Acme Air
+ contactPhone:
+ type: string
+ example: 1-888-1234-567
+ Flight:
+ required:
+ - airportFrom
+ - airportTo
+ - dateTime
+ - number
+ - price
+ - status
+ type: object
+ properties:
+ airline:
+ $ref: '#/components/schemas/Airline'
+ dateTime:
+ pattern: dateTime
+ type: string
+ example: 2016-03-05 18:00
+ number:
+ type: string
+ example: AC190
+ status:
+ type: string
+ example: On Schedule
+ airportFrom:
+ type: string
+ example: YYZ
+ airportTo:
+ type: string
+ example: LAX
+ price:
+ type: string
+ example: US$350
+ Booking:
+ required:
+ - airMiles
+ - seatPreference
+ type: object
+ properties:
+ departtureFlight:
+ $ref: '#/components/schemas/Flight'
+ returningFlight:
+ $ref: '#/components/schemas/Flight'
+ creditCard:
+ $ref: '#/components/schemas/CreditCard'
+ airMiles:
+ type: string
+ example: 32126319
+ seatPreference:
+ type: string
+ example: window
+ Review:
+ required:
+ - id
+ - rating
+ type: object
+ properties:
+ id:
+ type: string
+ example: 0
+ user:
+ $ref: '#/components/schemas/User'
+ airlines:
+ $ref: '#/components/schemas/Airline'
+ rating:
+ type: integer
+ example: 8
+ comment:
+ type: string
+ example: Great service!
+ CreditCard:
+ required:
+ - cardNumber
+ - cardholderName
+ - cvv
+ - expiryDate
+ - issuer
+ type: object
+ properties:
+ issuer:
+ type: string
+ example: VISA
+ cardholderName:
+ type: string
+ example: Joe Smith
+ cardNumber:
+ type: string
+ example: '**********1234'
+ cvv:
+ type: string
+ example: "0322"
+ expiryDate:
+ type: string
+ example: 04/19
+ securitySchemes:
+ reviewoauth2:
+ type: oauth2
+ description: authentication needed to create and delete reviews
+ flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:reviews: create a review
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/publish/servers/OpenAPIValidationServer/bootstrap.properties b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/publish/servers/OpenAPIValidationServer/bootstrap.properties
new file mode 100644
index 000000000000..25dde95fb6c5
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/publish/servers/OpenAPIValidationServer/bootstrap.properties
@@ -0,0 +1,2 @@
+bootstrap.include=../testports.properties
+com.ibm.ws.logging.trace.specification=*=info=enabled:mpOpenAPI=debug
\ No newline at end of file
diff --git a/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/publish/servers/OpenAPIValidationServer/server.xml b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/publish/servers/OpenAPIValidationServer/server.xml
new file mode 100644
index 000000000000..76b2a5ccaf52
--- /dev/null
+++ b/dev/io.openliberty.microprofile.openapi.4.0.internal_fat/publish/servers/OpenAPIValidationServer/server.xml
@@ -0,0 +1,13 @@
+