https://github.com/claudio-pereira-tech/spring-creating_api_documentation_with_restdocs
Spring - Creating API Documentation with Restdocs
https://github.com/claudio-pereira-tech/spring-creating_api_documentation_with_restdocs
documentation spring spring-boot spring-mvc
Last synced: 4 months ago
JSON representation
Spring - Creating API Documentation with Restdocs
- Host: GitHub
- URL: https://github.com/claudio-pereira-tech/spring-creating_api_documentation_with_restdocs
- Owner: claudio-pereira-tech
- License: mit
- Created: 2024-08-19T06:44:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-25T08:15:22.000Z (almost 2 years ago)
- Last Synced: 2025-03-06T15:06:06.094Z (over 1 year ago)
- Topics: documentation, spring, spring-boot, spring-mvc
- Language: Java
- Homepage: https://spring.io/guides/gs/testing-restdocs
- Size: 304 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Creating API Documentation with Restdocs
[![Contributors][contributors-shield]][contributors-url]
[![Stargazers][stars-shield]][stars-url]
[![Forks][forks-shield]][forks-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]

## About The Project
This application was developed following the guide [Creating API Documentation with Restdocs][gettingstarted-url]. The guide outlines building a simple RESTful API using [Spring Boot][springboot-url] and [Spring Framework][springframework-url], testing the endpoint, and setting up [Spring REST Docs][springrestdocs-url] to generate API documentation automatically through unit tests. The final result is a robust application that not only functions as intended but also features clear, up-to-date API documentation.
For this project, [Gradle][gradle-url] was selected as the build system and dependency manager, and [Kotlin][kotlin-url] as the build script language.
## Built With
* [![Java][java-shield]][java-url]
* [![SpringBoot][springboot-shield]][springboot-url]
* [![SpringFramework][springframework-shield]][springframework-url]
* [![Gradle][gradle-shield]][gradle-url]
* [![Docker][docker-shield]][docker-url]
## Getting Started
These instructions will guide setting up a local copy of the project and deploying the application using [Docker Compose][dockercompose-url] for demonstration purposes. Although these instructions are based on Linux distribution, the application can also be run on other operating systems with Docker Compose or Gradle, with the necessary adjustments not covered in this guide.
### Prerequisites
Requirements for downloading the project and deploying the application:
* [git][git-url] - version 2.14.1 or above
* [Docker Compose][dockercompose-url] - version V2
* Acknowledgment of Linux Fundamentals
### Downloading the project
```console
git clone https://github.com/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs.git
cd Spring-Creating_API_Documentation_with_Restdocs/docker
```
### Deploying the application
```console
docker compose up --detach
```
## Usage
To explore this project, access the API documentation available at http://localhost or consume the API endpoint at http://localhost/api.
### Accessing the API documentation
To access the API documentation, open http://localhost in the preferred web browser.
### Consuming the API endpoint
To consume the API endpoint, use a preferred API testing tool (e.g., [Postman][postman-url], [Insomnia][insomnia-url], [curl][curl-url], [httpie][httpie-url]) to perform a GET request to http://localhost/api.
#### Requesting with curl
```console
curl 'http://localhost/api/' -i -X GET
```
#### Requesting with httpie
```console
http GET 'http://localhost/api/'
```
## Terminate
After finishing all demonstrations, terminate the deployment and remove the built image.
### Terminating the deployment and removing the built image
```console
docker compose down --rmi local
```
## License
Distributed under the MIT License. See [LICENSE.md][license-url] for more information.
## Contact
Cláudio de Oliveira Pereira - claudio@pereira.tech - [LinkedIn][linkedin-url]
Project Link: [https://github.com/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs][project-url]
## Support
If value has been found in this project and it has been helpful in any way, support would be greatly appreciated.
[contributors-shield]: https://img.shields.io/github/contributors/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs?style=for-the-badge
[contributors-url]: https://github.com/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs/graphs/contributors/
[stars-shield]: https://img.shields.io/github/stars/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs?style=for-the-badge
[stars-url]: https://github.com/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs/stargazers/
[forks-shield]: https://img.shields.io/github/forks/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs?style=for-the-badge
[forks-url]: https://github.com/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs/network/members/
[issues-shield]: https://img.shields.io/github/issues/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs?style=for-the-badge
[issues-url]: https://github.com/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs/issues/
[license-shield]: https://img.shields.io/github/license/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs?style=for-the-badge
[license-url]: https://github.com/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs/blob/main/LICENSE.md
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/claudio-oliveira-pereira/
[springboot-shield]: https://img.shields.io/badge/Spring_Boot-3.3.2-white?style=for-the-badge&logo=springboot&logoColor=white&logoSize=auto&labelColor=6DB33F&color=grey
[springboot-url]: https://spring.io/projects/spring-boot/
[springframework-shield]: https://img.shields.io/badge/Spring_Framework-6.1.12-white?style=for-the-badge&logo=spring&logoColor=white&logoSize=auto&labelColor=6DB33F&color=grey
[springframework-url]: https://spring.io/projects/spring-framework/
[gradle-shield]: https://img.shields.io/badge/Gradle-02303A?style=for-the-badge&logo=gradle&logoColor=white&logoSize=auto
[gradle-url]: https://gradle.org/
[java-shield]: https://img.shields.io/badge/Liberica_JDK-22.0.2-white?style=for-the-badge&logo=openjdk&logoColor=black&logoSize=auto&labelColor=5BD5EF&color=grey
[java-url]: https://bell-sw.com/libericajdk/
[docker-shield]: https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white&logoSize=auto
[docker-url]: https://www.docker.com/
[gettingstarted-url]: https://spring.io/guides/gs/testing-restdocs/
[springrestdocs-url]: https://spring.io/projects/spring-restdocs/
[kotlin-url]: https://kotlinlang.org/
[dockercompose-url]: https://docs.docker.com/compose/
[git-url]: https://git-scm.com/
[postman-url]: https://www.postman.com/
[insomnia-url]: https://insomnia.rest/
[curl-url]: https://curl.se/
[httpie-url]: https://httpie.io/
[project-url]: https://github.com/claudio-pereira-tech/Spring-Creating_API_Documentation_with_Restdocs/
