diff --git a/appserver/packager/microprofile-package/pom.xml b/appserver/packager/microprofile-package/pom.xml
index 1c7a0bd95f5..ba300f1449f 100644
--- a/appserver/packager/microprofile-package/pom.xml
+++ b/appserver/packager/microprofile-package/pom.xml
@@ -165,6 +165,18 @@
microprofile-metrics
${project.version}
+
+
+
+ org.eclipse.microprofile.openapi
+ microprofile-openapi-api
+ ${microprofile-openapi.version}
+
+
+ fish.payara.microprofile.openapi
+ microprofile-openapi
+ ${project.version}
+
diff --git a/appserver/payara-appserver-modules/microprofile/openapi/pom.xml b/appserver/payara-appserver-modules/microprofile/openapi/pom.xml
new file mode 100644
index 00000000000..3af1dce104e
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/openapi/pom.xml
@@ -0,0 +1,101 @@
+
+
+
+ 4.0.0
+
+
+ fish.payara.microprofile
+ microprofile
+ 5.182-SNAPSHOT
+
+
+ fish.payara.microprofile.openapi
+ microprofile-openapi
+ glassfish-jar
+
+ Microprofile - OpenAPI
+ Implementation of MicroProfile OpenAPI
+
+
+
+ org.eclipse.microprofile.config
+ microprofile-config-api
+ ${microprofile-config.version}
+
+
+ org.eclipse.microprofile.openapi
+ microprofile-openapi-api
+ ${microprofile-openapi.version}
+
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey.version}
+
+
+ org.glassfish.main.web
+ web-glue
+ ${project.version}
+
+
+ org.glassfish.main.common
+ internal-api
+ ${project.version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+ javax
+ javaee-api
+ 8.0
+
+
+ junit
+ junit
+
+
+
diff --git a/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/processor/OASProcessor.java b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/processor/OASProcessor.java
new file mode 100644
index 00000000000..e27bbc2c69a
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/processor/OASProcessor.java
@@ -0,0 +1,61 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://github.com/payara/Payara/blob/master/LICENSE.txt
+ * See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * The Payara Foundation designates this particular file as subject to the "Classpath"
+ * exception as provided by the Payara Foundation in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package fish.payara.microprofile.openapi.api.processor;
+
+import org.eclipse.microprofile.openapi.models.OpenAPI;
+
+import fish.payara.microprofile.openapi.impl.config.OpenApiConfiguration;
+
+/**
+ * A processor accepts an {@link OpenAPI} object, and returns a new model after
+ * applying a transformation.
+ */
+public interface OASProcessor {
+
+ /**
+ * Processes a model.
+ *
+ * @param api the OpenAPI model to process.
+ * @param config the configuration to use.
+ * @return a processed model.
+ */
+ OpenAPI process(OpenAPI api, OpenApiConfiguration config);
+
+}
\ No newline at end of file
diff --git a/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/visitor/ApiContext.java b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/visitor/ApiContext.java
new file mode 100644
index 00000000000..082f985c498
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/visitor/ApiContext.java
@@ -0,0 +1,67 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://github.com/payara/Payara/blob/master/LICENSE.txt
+ * See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * The Payara Foundation designates this particular file as subject to the "Classpath"
+ * exception as provided by the Payara Foundation in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package fish.payara.microprofile.openapi.api.visitor;
+
+import org.eclipse.microprofile.openapi.models.OpenAPI;
+import org.eclipse.microprofile.openapi.models.Operation;
+
+/**
+ * The context in which a class object is being visited. For example, if a
+ * method is being visited, the context will contain the current state of the
+ * {@link OpenAPI}, and the current path in the API.
+ */
+public interface ApiContext {
+
+ /**
+ * The current {@link OpenAPI} object being operated on.
+ */
+ OpenAPI getApi();
+
+ /**
+ * The path of the object currently being visited. If the path is null, the
+ * object has no context (e.g a POJO).
+ */
+ String getPath();
+
+ /**
+ * The created operation currently being worked on.
+ */
+ Operation getWorkingOperation();
+}
\ No newline at end of file
diff --git a/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/visitor/ApiVisitor.java b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/visitor/ApiVisitor.java
new file mode 100644
index 00000000000..d65b96b40b9
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/visitor/ApiVisitor.java
@@ -0,0 +1,163 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://github.com/payara/Payara/blob/master/LICENSE.txt
+ * See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * The Payara Foundation designates this particular file as subject to the "Classpath"
+ * exception as provided by the Payara Foundation in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package fish.payara.microprofile.openapi.api.visitor;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Method;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.CookieParam;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.HEAD;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.OPTIONS;
+import javax.ws.rs.PATCH;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+
+import org.eclipse.microprofile.openapi.annotations.ExternalDocumentation;
+import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
+import org.eclipse.microprofile.openapi.annotations.Operation;
+import org.eclipse.microprofile.openapi.annotations.callbacks.Callback;
+import org.eclipse.microprofile.openapi.annotations.callbacks.Callbacks;
+import org.eclipse.microprofile.openapi.annotations.extensions.Extension;
+import org.eclipse.microprofile.openapi.annotations.media.Schema;
+import org.eclipse.microprofile.openapi.annotations.parameters.Parameter;
+import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody;
+import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
+import org.eclipse.microprofile.openapi.annotations.responses.APIResponses;
+import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement;
+import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements;
+import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme;
+import org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes;
+import org.eclipse.microprofile.openapi.annotations.servers.Server;
+import org.eclipse.microprofile.openapi.annotations.servers.Servers;
+import org.eclipse.microprofile.openapi.annotations.tags.Tag;
+import org.eclipse.microprofile.openapi.annotations.tags.Tags;
+
+public interface ApiVisitor {
+
+ /**
+ * Generic representation of each of these functions.
+ */
+ @FunctionalInterface
+ interface VisitorFunction {
+ void apply(A annotation, E element, ApiContext context);
+ }
+
+ // JAX-RS annotations
+
+ void visitGET(GET get, Method element, ApiContext context);
+
+ void visitPOST(POST post, Method element, ApiContext context);
+
+ void visitPUT(PUT put, Method element, ApiContext context);
+
+ void visitDELETE(DELETE delete, Method element, ApiContext context);
+
+ void visitHEAD(HEAD head, Method element, ApiContext context);
+
+ void visitOPTIONS(OPTIONS options, Method element, ApiContext context);
+
+ void visitPATCH(PATCH patch, Method element, ApiContext context);
+
+ void visitProduces(Produces produces, AnnotatedElement element, ApiContext context);
+
+ void visitConsumes(Consumes produces, AnnotatedElement element, ApiContext context);
+
+ void visitQueryParam(QueryParam param, java.lang.reflect.Parameter element, ApiContext context);
+
+ void visitPathParam(PathParam param, java.lang.reflect.Parameter element, ApiContext context);
+
+ void visitFormParam(FormParam param, java.lang.reflect.Parameter element, ApiContext context);
+
+ void visitHeaderParam(HeaderParam param, java.lang.reflect.Parameter element, ApiContext context);
+
+ void visitCookieParam(CookieParam param, java.lang.reflect.Parameter element, ApiContext context);
+
+ // OpenAPI annotations
+
+ void visitOpenAPI(OpenAPIDefinition definition, AnnotatedElement element, ApiContext context);
+
+ void visitSchema(Schema schema, AnnotatedElement element, ApiContext context);
+
+ void visitExtension(Extension extension, AnnotatedElement element, ApiContext context);
+
+ void visitOperation(Operation operation, AnnotatedElement element, ApiContext context);
+
+ void visitCallback(Callback callback, AnnotatedElement element, ApiContext context);
+
+ void visitCallbacks(Callbacks callbacks, AnnotatedElement element, ApiContext context);
+
+ void visitRequestBody(RequestBody requestBody, AnnotatedElement element, ApiContext context);
+
+ void visitAPIResponse(APIResponse apiResponse, AnnotatedElement element, ApiContext context);
+
+ void visitAPIResponses(APIResponses apiResponses, AnnotatedElement element, ApiContext context);
+
+ void visitParameter(Parameter parameter, AnnotatedElement element, ApiContext context);
+
+ void visitExternalDocumentation(ExternalDocumentation externalDocs, AnnotatedElement element, ApiContext context);
+
+ void visitServer(Server server, AnnotatedElement element, ApiContext context);
+
+ void visitServers(Servers servers, AnnotatedElement element, ApiContext context);
+
+ void visitTag(Tag tag, AnnotatedElement element, ApiContext context);
+
+ void visitTags(Tags tags, AnnotatedElement element, ApiContext context);
+
+ void visitSecurityScheme(SecurityScheme securityScheme, AnnotatedElement element, ApiContext context);
+
+ void visitSecuritySchemes(SecuritySchemes securitySchemes, AnnotatedElement element, ApiContext context);
+
+ void visitSecurityRequirement(SecurityRequirement securityRequirement, AnnotatedElement element,
+ ApiContext context);
+
+ void visitSecurityRequirements(SecurityRequirements securityRequirements, AnnotatedElement element,
+ ApiContext context);
+
+}
\ No newline at end of file
diff --git a/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/visitor/ApiWalker.java b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/visitor/ApiWalker.java
new file mode 100644
index 00000000000..d0b89cfeea3
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/api/visitor/ApiWalker.java
@@ -0,0 +1,53 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://github.com/payara/Payara/blob/master/LICENSE.txt
+ * See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * The Payara Foundation designates this particular file as subject to the "Classpath"
+ * exception as provided by the Payara Foundation in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package fish.payara.microprofile.openapi.api.visitor;
+
+/**
+ * Represents an object that can traverse an API
+ * by passing each element to the given {@link ApiVisitor}.
+ */
+public interface ApiWalker {
+
+ /**
+ * Traverse the API, passing each element to the visitor
.
+ * @param visitor the visitor to pass each element to.
+ */
+ void accept(ApiVisitor visitor);
+}
\ No newline at end of file
diff --git a/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/impl/OpenApiService.java b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/impl/OpenApiService.java
new file mode 100644
index 00000000000..5d4909708cc
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/impl/OpenApiService.java
@@ -0,0 +1,245 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://github.com/payara/Payara/blob/master/LICENSE.txt
+ * See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * The Payara Foundation designates this particular file as subject to the "Classpath"
+ * exception as provided by the Payara Foundation in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package fish.payara.microprofile.openapi.impl;
+
+import static java.util.stream.Collectors.toSet;
+
+import java.beans.PropertyChangeEvent;
+import java.util.Collections;
+import java.util.Deque;
+import java.util.Enumeration;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentLinkedDeque;
+import java.util.logging.Logger;
+
+import javax.inject.Inject;
+
+import org.eclipse.microprofile.openapi.models.OpenAPI;
+import org.glassfish.api.StartupRunLevel;
+import org.glassfish.api.deployment.archive.ReadableArchive;
+import org.glassfish.api.event.EventListener;
+import org.glassfish.api.event.Events;
+import org.glassfish.hk2.api.PostConstruct;
+import org.glassfish.hk2.api.PreDestroy;
+import org.glassfish.hk2.runlevel.RunLevel;
+import org.glassfish.internal.api.Globals;
+import org.glassfish.internal.data.ApplicationInfo;
+import org.glassfish.internal.deployment.Deployment;
+import org.glassfish.web.deployment.descriptor.WebBundleDescriptorImpl;
+import org.jvnet.hk2.annotations.Service;
+import org.jvnet.hk2.config.Changed;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.ConfigListener;
+import org.jvnet.hk2.config.ConfigSupport;
+import org.jvnet.hk2.config.NotProcessed;
+import org.jvnet.hk2.config.UnprocessedChangeEvents;
+
+import fish.payara.microprofile.openapi.impl.admin.OpenApiServiceConfiguration;
+import fish.payara.microprofile.openapi.impl.config.OpenApiConfiguration;
+import fish.payara.microprofile.openapi.impl.model.OpenAPIImpl;
+import fish.payara.microprofile.openapi.impl.processor.ApplicationProcessor;
+import fish.payara.microprofile.openapi.impl.processor.BaseProcessor;
+import fish.payara.microprofile.openapi.impl.processor.FileProcessor;
+import fish.payara.microprofile.openapi.impl.processor.FilterProcessor;
+import fish.payara.microprofile.openapi.impl.processor.ModelReaderProcessor;
+
+@Service(name = "microprofile-openapi-service")
+@RunLevel(StartupRunLevel.VAL)
+public class OpenApiService implements PostConstruct, PreDestroy, EventListener, ConfigListener {
+
+ private static final Logger LOGGER = Logger.getLogger(OpenApiService.class.getName());
+
+ private Deque