Skip to content

Commit

Permalink
docs: update readme [skip ci] (ePages-de#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmewes authored May 16, 2023
1 parent 4893605 commit de0c1ab
Showing 1 changed file with 28 additions and 40 deletions.
68 changes: 28 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Spring REST Docs API specification Integration

[![oss lifecycle](https://img.shields.io/badge/oss_lifecycle-maintenance-yellow.svg)](https://github.com/ePages-de/restdocs-api-spec/issues/204)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ePages-de_restdocs-api-spec&metric=coverage)](https://sonarcloud.io/summary/new_code?id=ePages-de_restdocs-api-spec)
![](https://img.shields.io/github/license/ePages-de/restdocs-openapi.svg)
[![Maven Central](https://img.shields.io/maven-central/v/com.epages/restdocs-api-spec)](https://search.maven.org/artifact/com.epages/restdocs-api-spec)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/restdocs-api-spec/Lobby)
Expand Down Expand Up @@ -62,7 +63,6 @@ This is why we came up with this project.
- [OpenAPI 3.0.1](#openapi-301-1)
- [Postman](#postman-1)
- [Generate an HTML-based API reference from OpenAPI](#generate-an-html-based-api-reference-from-openapi)
- [RAML](#raml)

## Getting started

Expand Down Expand Up @@ -94,7 +94,7 @@ The [ResourceSnippet](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apis
* Using the [plugins DSL](https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block):
```groovy
plugins {
id 'com.epages.restdocs-api-spec' version '0.16.0'
id 'com.epages.restdocs-api-spec' version '0.18.2'
}
```
Examples with Kotlin are also available [here](https://plugins.gradle.org/plugin/com.epages.restdocs-api-spec)
Expand All @@ -110,7 +110,7 @@ The [ResourceSnippet](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apis
}
}
dependencies {
classpath "com.epages:restdocs-api-spec-gradle-plugin:0.16.0" //1.2
classpath "com.epages:restdocs-api-spec-gradle-plugin:0.18.2" //1.2
}
}
Expand All @@ -129,7 +129,7 @@ The [ResourceSnippet](restdocs-api-spec/src/main/kotlin/com/epages/restdocs/apis
dependencies {
//..
testImplementation('com.epages:restdocs-api-spec-mockmvc:0.16.0') //2.2
testImplementation('com.epages:restdocs-api-spec-mockmvc:0.18.2') //2.2
}
openapi { //2.3
Expand Down Expand Up @@ -569,52 +569,40 @@ redoc-cli bundle build/api-spec/openapi.json
redoc-cli serve build/api-spec/openapi.json
```

## RAML
## Maintenance

This project supersedes [restdocs-raml](https://github.com/ePages-de/restdocs-raml).
So if you are coming from `restdocs-raml` you might want to switch to `restdocs-api-spec`.
This section of the README is targeted at project maintainers.

The API of both projects is fairly similar and it is easy to migrate.
### Publish project

We plan to support RAML in the future.
In the meantime you can use one of several ways to convert an OpenAPI specification to RAML.
There are converters around that can help you to achieve this conversion.
The project is published with the help of [GitHub Actions](./.github/workflows).
It's version number is determined by the Git tags (see [allegro/axion-release-plugin](https://axion-release-plugin.readthedocs.io)).
The Java dependencies are published to Sonatype with the help of the [gradle-nexus/publish-plugin](https://github.com/gradle-nexus/publish-plugin) and the Maven Publish Plugin.
The Gradle plugin is published to the [Gradle plugin portal](https://plugins.gradle.org/plugin/com.epages.restdocs-api-spec) with the help of the ['plugin-publish' plugin](https://plugins.gradle.org/plugin/com.gradle.plugin-publish) (see [docs.gradle.org](https://docs.gradle.org/current/userguide/publishing_gradle_plugins.html)).
- [oas-raml-converter](https://github.com/mulesoft/oas-raml-converter) - an npm project that provides a CLI to convert between OpenAPI and RAML - it also provides an [online converter](https://mulesoft.github.io/oas-raml-converter/)
- [api-matic](https://apimatic.io/transformer) - an online converter capable of converting between many api specifications
Given that the `master` branch on the upstream repository is in the state from which you want to create a release, execute the following steps:
In the [sample project](samples/restdocs-api-spec-sample) you find a build configuration that uses the [oas-raml-converter-docker](https://hub.docker.com/r/zaddo/oas-raml-converter-docker/) docker image and the [gradle-docker-plugin](https://github.com/bmuschko/gradle-docker-plugin) to leverage the `oas-raml-converter` to convert the output of the `openapi` task to RAML.
Using this approach your gradle build can still output a RAML specification.
**(1) Create release**
See [openapi2raml.gradle](samples/restdocs-api-spec-sample/openapi2raml.gradle).
[Create release via the GitHub UI](https://github.com/ePages-de/restdocs-api-spec/releases/new).
```
./gradlew restdocs-api-spec-sample:openapi
./gradlew -b samples/restdocs-api-spec-sample/openapi2raml.gradle openapi2raml
```
Use the intended version number as "Tag version", e.g. "0.18.2".
This will automatically trigger a GitHub Action build which publishes the JAR files for this release to Sonatype.
## Maintenance
**(2) Login to Sonatype**
This section of the README is targeted at project maintainers.
Login to Sonatype and navigate to the [staging repositories](https://oss.sonatype.org/#stagingRepositories).
### Publish project
**(3) Close the staging repository**
Select the generated staging repository and close it.
Check that there are no errors afterwards (e.g. missing signatures or Javadoc JARs).
~~The project is published with the help of [TravisCI](./.travis.yml).~~
It's version number is determined by the Git tags (see [allegro/axion-release-plugin](https://axion-release-plugin.readthedocs.io)).
The Java dependencies are published to Sonatype with the help of the [gradle-nexus/publish-plugin](https://github.com/gradle-nexus/publish-plugin) and the Maven Publish Plugin.
The Gradle plugin is published to the [Gradle plugin portal](https://plugins.gradle.org/plugin/com.epages.restdocs-api-spec) with the help of the ['plugin-publish' plugin](https://plugins.gradle.org/plugin/com.gradle.plugin-publish) (see [docs.gradle.org](https://docs.gradle.org/current/userguide/publishing_gradle_plugins.html)).
**(4) Release the repository**
Given that the `master` branch on the upstream repository is in the state from which you want to create a release, execute the following steps:
Select the generated staging repository and release it.
After few minutes, the release should be available in the ["Public Repositories" of ePages](https://oss.sonatype.org/service/local/repo_groups/public/content/com/epages/).
**(5) Update documentation**
1. [Create release via the GitHub UI](https://github.com/ePages-de/restdocs-api-spec/releases/new) <br>
Use the intended version number as "Tag version", e.g. "0.16.0".
~~This will automatically trigger a Travis build which publishes the JAR files for this release to Sonatype.~~
2. Login to Sonatype and navigate to the [staging repositories](https://oss.sonatype.org/#stagingRepositories)
3. Close the staging repository <br>
Select the generated staging repository and close it.
Check that there are no errors afterwards (e.g. missing signatures or Javadoc JARs).
4. Release the repository <br>
Select the generated staging repository and release it.
Soon after, the release should be available in the ["Public Repositories" of ePages](https://oss.sonatype.org/service/local/repo_groups/public/content/com/epages/).
5. Update documentation <br>
Create a new commit which updates the version numbers in the `README` file.
Create a new commit which updates the version numbers in the `README` file.

0 comments on commit de0c1ab

Please sign in to comment.