You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The syncDirectory goal allows you to synchronize a directory containing specification files with swaggerhub. You will use this sync implementation if you are working code first and generating your specifications. See sync logic for the overall sync logic.
By default this goal will run in the verify phase, so configuration is minimal.
This goal does rely on a number of conventions though, since potentially multiple specifications, both API and DOMAIN, are synchronised.
If you want your API or DOMAIN to be private on swaggerhub, you need to include the private. prefix; otherwise the specification will be public.
The owner should typically be ORGANISATION and is the swaggerhub owner of the specification. It is required.
The api is the name of the api or domain on swaggerhub. It is required.
You will need to use majorVersion if you simultaneously support more than 1 major version (otherwise the file names will be identical).
There is a choice between all supported formats and supported OAS version for SwaggerHub.
In contrast with thesyncFile goal, we also expect the semantic version of the API or DOMAIN to be present in the specification under $.info.version!
The syncFile goal allows you to synchronize a single api specificatin file with swaggerhub. You will use this sync implementation if you are writing an openapi spec from scratch. See sync logic for the overall sync logic.
a version is considered to be a snapshot if the version contains a -
are always uploaded to swaggerhub
Release versions
a version is considered to be a release if the version does not contain a -
if a release version does not yet exists in swaggerhub the specification will be uploaded
if a release version already exists it will first be downloaded and compared with the new one that is going to be uploaded
** the build will fail if the 2 specification do not match
** nothing will be uploaded if both specifications are the same
API vs. Domain
The original swaggerhub-maven-plugin differentiates both concepts by explicitly specifing if you are uploading an API or a Domain specification.
The customize plugin applies the following rules:
no paths specified in the specication => Domain
paths specified in the specication => API
Configuration defaults
Global
These are the global configuration properties that can be overridden for every goal
Property
Default
Purpose
host
swaggerhub.ORGANISATION.XX
The swaggerhub host name
port
80
The swaggerhub port
protocol
http
The swaggerhub protocol
basePath
v1
The swaggerhub API base path
owner
ORGANISATION
The default API/Domain owner
skipFailures
false
Ignore errors when interacting with swaggerhub
The text was updated successfully, but these errors were encountered:
We have wrapped swaggerhub-maven-plugin to provide the following goals for our organization:
This gives us 2 benefits for us;
Point 1 is not interesting to contribute back, but is there any interest in a contribution of syncFile and syncDirectory?
Below is our readme.md for reference:
ORGANISATION-swaggerhub-maven-plugin
Customized version of the swaggerhub-maven-plugin.
Customizations include
Current version
Goals
get
The
get
goal can be used to retrieve an API specification from swaggerhub and store it locally for further processing.Example
Configuration
${project.build.directory}/openapi-spec.json
See also global configuration
syncDirectory
The
syncDirectory
goal allows you to synchronize a directory containing specification files with swaggerhub. You will use this sync implementation if you are working code first and generating your specifications. See sync logic for the overall sync logic.By default this goal will run in the verify phase, so configuration is minimal.
This goal does rely on a number of conventions though, since potentially multiple specifications, both API and DOMAIN, are synchronised.
We expect a certain file format:
If you want your API or DOMAIN to be private on swaggerhub, you need to include the
private.
prefix; otherwise the specification will be public.The
owner
should typically beORGANISATION
and is the swaggerhub owner of the specification. It is required.The
api
is the name of the api or domain on swaggerhub. It is required.You will need to use
majorVersion
if you simultaneously support more than 1 major version (otherwise the file names will be identical).There is a choice between all supported formats and supported OAS version for SwaggerHub.
In contrast with the
syncFile
goal, we also expect the semantic version of the API or DOMAIN to be present in the specification under$.info.version
!Example
Configuration
false
See also global configuration
syncFile
The
syncFile
goal allows you to synchronize a single api specificatin file with swaggerhub. You will use this sync implementation if you are writing an openapi spec from scratch. See sync logic for the overall sync logic.Example
Configuration
$.info.version
defined in the file${project.build.directory}/openapi.yaml
false
false
See also global configuration
Sync logic
Snapshot versions
-
Release versions
-
** the build will fail if the 2 specification do not match
** nothing will be uploaded if both specifications are the same
API vs. Domain
The original swaggerhub-maven-plugin differentiates both concepts by explicitly specifing if you are uploading an API or a Domain specification.
The customize plugin applies the following rules:
paths
specified in the specication => Domainpaths
specified in the specication => APIConfiguration defaults
Global
These are the global configuration properties that can be overridden for every goal
swaggerhub.ORGANISATION.XX
http
v1
ORGANISATION
false
The text was updated successfully, but these errors were encountered: