swagger-maven-plugin | SpringMVC supported maven build plugin | REST library

 by   kongchen Java Version: swagger-maven-plugin-3.1.8 License: Apache-2.0

kandi X-RAY | swagger-maven-plugin Summary

kandi X-RAY | swagger-maven-plugin Summary

swagger-maven-plugin is a Java library typically used in Web Services, REST, Swagger applications. swagger-maven-plugin has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, Maven.

This plugin enables your Swagger-annotated project to generate Swagger specs and customizable, templated static documents during the maven build phase. Unlike swagger-core, swagger-maven-plugin does not actively serve the spec with the rest of the application; it generates the spec as a build artifact to be used in downstream Swagger tooling.

            kandi-support Support

              swagger-maven-plugin has a highly active ecosystem.
              It has 737 star(s) with 438 fork(s). There are 50 watchers for this library.
              It had no major release in the last 6 months.
              There are 292 open issues and 284 have been closed. On average issues are closed in 109 days. There are 37 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of swagger-maven-plugin is swagger-maven-plugin-3.1.8

            kandi-Quality Quality

              swagger-maven-plugin has 0 bugs and 0 code smells.

            kandi-Security Security

              swagger-maven-plugin has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              swagger-maven-plugin code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              swagger-maven-plugin is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              swagger-maven-plugin releases are not available. You will need to build from source code and install.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              It has 12982 lines of code, 690 functions and 122 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed swagger-maven-plugin and discovered the below as its top functions. This is intended to give you an instant insight into swagger-maven-plugin implemented functionality, and help decide if they suit your requirements.
            • Executes the builder
            • Loads the model modifier
            • Create a new Swagger documents
            • Compiles the Swagger
            • Overrides the default implementation to skip parameters that should be ignored
            • Extract parameters from annotation
            • Extract the cookie parameter
            • Extract form parameter
            • Overrides the default implementation to be skipped
            • Checks that a list of method annotations has a valid annotation
            • Returns the list of parameters that should be skipped
            • Extracts the types of the given bean
            • Overridden to skip parameters
            • Extract parameters from model annotation
            • Checks if is a primitive type
            • Retrieves the parameters from the annotations
            • Overrides superclass to override superclass
            • Remove a property from the model
            • Overrides the superclass to resolve the model type
            • Converts the given type into a JavaType
            • Creates a file in the given directory
            • Update extensions with custom extensions
            • Overrides superclass to superclasses
            Get all kandi verified functions for this library.

            swagger-maven-plugin Key Features

            No Key Features are available at this moment for swagger-maven-plugin.

            swagger-maven-plugin Examples and Code Snippets

            No Code Snippets are available at this moment for swagger-maven-plugin.

            Community Discussions


            How to add a goal to release:perform phase of maven-release-plugin
            Asked 2021-Apr-22 at 18:07

            I use the swagger-maven-plugin from kongchen. Additionally I use the maven-release-plugin. The swagger.json which is generated from swagger-maven-plugin is not part of the repo. If I build the application with mvn package the swagger.json is generated and part of the jar.

            If I release the app with maven-release-plugin the swagger.json is not part of the jar-file. I checked the logs and saw that maven-release-plugin has three steps - release:clean, release:prepare and perform.

            release:clean - cleans the workspace

            release:prepare - logs show that the swagger-maven-plugin works and generated the swagger.json

            release:perform - logs show that perform is composed of three phases (verify-completed-prepare-phases, checkout-prjoect-from-scm and run-perform-goals). I think this means that the whole project is checked out again and therefore the generated file is gone (how great is that...).

            How can I add another phase to release:perform?

            I found the following documentation https://maven.apache.org/maven-release/maven-release-manager/index.html and know that additional preparation goals can be added https://maven.apache.org/maven-release/maven-release-plugin/examples/run-goals-before-commit.html

            I need to add goals to the release:perform step (for example compile or package). How can I achieve that?




            Answered 2021-Apr-22 at 18:07

            You need to set the goals parameter of release:perform. This contains the goals that are executed in the "inner build".

            Source https://stackoverflow.com/questions/67218029


            How to generate OpenAPI specification in WebFlux project as part of maven build without starting service
            Asked 2020-Dec-03 at 19:52

            We are using SpringDoc in our WebFlux project to annotate our APIs and serve OpenAPI documentation from a UI. However, now we need the OpenAPI file generated as part of the maven build.

            SpringDoc has a plugin to fetch the file from a running service, where the service has been started by spring plugin, but our service requires a lot of stuff to be set up in order to run. We are doing this setup in our tests' @BeforeClass and don't want to extract that setup (and the corresponding cleanup) just so that the service can be started as part of the maven build. Plus we plan to eventually stop starting up the service for our tests and instead use mocks, so adding a test to retrieve the file from the running test is only a temporary solution (would like to not have to maintain startup code just in order to retrieve the OpenAPI doc).

            I have tried using the swagger-maven-plugin from swagger-core, but it seems to require jaxrs, which we are not using. I have also looked into SpringFox, but it also does not offer the desired functionality.

            Any ideas on how to generate OpenAPI documentation for a WebFlux project as part of the maven build without starting the service?



            Answered 2020-Dec-03 at 05:00

            You can try using the below OpenAPI Maven Plugin from the OpenAPI Tools project. The advantage it offers is, it works even when you run your build without tests and as long as there are no compile errors.

            Source https://stackoverflow.com/questions/65113364


            Jersey 1.x - Uplifting Swagger 1.x to 2.x
            Asked 2020-Sep-12 at 13:29

            I have a Jersey application that's currently using Swagger 1.6

            Below are the important segments from the pom file of the project



            Answered 2020-Sep-12 at 13:29

            Replacing the plugin with the one below works

            Source https://stackoverflow.com/questions/63581964


            How to use @Api swagger annotation in sub-resource class?
            Asked 2020-May-28 at 20:14

            In my project I have some sub-resources, correctly implemented according to the Jersey framework guidelines.

            However, I have a problem in generating the openapi.json file (generated by swagger-maven-plugin). In particular, I would like to be able to use the @Api swagger annotation on classes that implement sub-resources, to apply some properties, such as authorizations.

            The problem is that if I use the @Api annotation on the sub-resource classes, swagger sees those classes not only as a sub-resources, but also as resources. The result is that in the openapi.json file, for each sub-resource, a same resource is generated (which should not exist).

            The root resource:



            Answered 2020-May-28 at 20:14

            The solution was quite simple. To ensure that the class that implements the sub-resource is seen by swagger just as a sub-resource (and not as a resource too) just add the property hidden = true in the @Api annotation

            Source https://stackoverflow.com/questions/60948785


            @BeanParam not documented when annotated with @Parameter
            Asked 2020-Feb-27 at 20:14

            I'm trying to document my api using the swagger-maven-plugin.

            When I annotate a route param with @Parameter, it's well documented in the openapi generated file as long as it's not annotated with @BeanParam.

            As stated in the swagger core documentation,

            The @Parameter can be used in place of or together with the JAX-RS parameter annotations (@PathParam, @QueryParam, @HeaderParam, @FormParam and @BeanParam). While swagger-core / swagger-jaxrs2 scan these annotations by default, the @Parameter allows to define more details for the parameter.

            How can I get my @BeanParam parameters documented in my openapi file?

            Here is my pom.xml:



            Answered 2020-Feb-27 at 20:14

            After some trials I managed to document my @BeanParam in the openapi file. Annotations have to be put inside of the class annotated @BeanParam like this:

            Source https://stackoverflow.com/questions/60418319


            Swagger/OpenAPI 3.0 generation - Endpoint with generic list from an interface does not show up in documentation
            Asked 2020-Feb-21 at 11:32

            I'm trying to generate a API documentation/swagger client for a Java EE application using Swagger / OpenAPI 3.0, but one method keeps missing in the documentation. I created a sample project to clarify my problem:

            New, less complex example:

            I got an Interface with a List as a parameter for my REST endpoint:



            Answered 2020-Feb-21 at 11:32

            this feels like a bug to me. As a work-around you could just wrap your list into another object, without any type parameter it should work.


            Source https://stackoverflow.com/questions/60188417

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install swagger-maven-plugin

            You can download it from GitHub, Maven.
            You can use swagger-maven-plugin like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the swagger-maven-plugin component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone kongchen/swagger-maven-plugin

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link