🧩 Overview
The Petstore API Demo is a hands-on Spring Boot project that implements a simple Pet Store with API versioning, CRUD operations, and Swagger documentation.
It’s inspired by the official Swagger Petstore API and serves as a reference implementation for developers who want to learn, test, or experiment with building RESTful APIs using Spring Boot.
👉 GitHub Repository: BathiyaL/petstore-api-demo
🎯 Project Purpose
This project was created for educational and testing purposes.
It demonstrates how to structure a clean, maintainable REST API with flexible configuration.
Whether you’re:
- Learning Spring Boot
- Practicing API automation
- Or building a test sandbox
This demo offers a great starting point.
🚀 Key Features
✅ Two Operational Modes
- 🛰️ Remote Mode: Delegates API calls to an external Pet API.
- 💾 Local Mode: Uses an embedded H2 database for local data storage.
✅ Core Highlights
- RESTful API for managing pets (
GET,POST,PUT,DELETE) - Built with Spring Boot + Spring Data JPA
- Swagger UI & OpenAPI 3 docs with SpringDoc
- Profile-based configuration for flexible environments
- Custom health check endpoint to verify app status
🔧 Prerequisites
Before running the project, ensure you have:
- ☕ Java 17+
- 🛠️ Gradle
- 💻 IDE or Command-Line Tools
⚙️ Setup & Build
Add a “Code” block in WordPress and paste the following:
# Clone the repository
git clone https://github.com/BathiyaL/petstore-api-demo.git
cd petstore-api-demo
# Build the project
./gradlew clean build
▶️ Run the Application
Use another Code block for the command:
./gradlew bootRun
Once the application starts, you can access:
- 🌐 API Root: http://localhost:8080/api/v1/pets
- 📄 Swagger UI: http://localhost:8080/api/v1/swagger-ui/index.html
- 🧾 OpenAPI Spec: http://localhost:8080/api/v1/api-docs
- 💚 Health Check: http://localhost:8080/api/v1/health
💡 Why This Project Matters
This demo is perfect for developers, QA engineers, or testers exploring:
- How to design REST APIs in Spring Boot
- Switching between local and remote data modes
- Integrating Swagger/OpenAPI for documentation
- Practicing API testing and automation
It’s small, fast, and production-like — a great sandbox for learning.
🤝 Contributing
Contributions and ideas are always welcome!
If you’d like to:
- Add new features
- Fix bugs
- Or enhance documentation
Please open a Pull Request or create an Issue on GitHub.
📦 Resources
🔗 GitHub Repo: BathiyaL/petstore-api-demo
📘 Swagger Petstore Reference: https://petstore.swagger.io/
💻 Author: Bathiya Ladduwahetty
📅 Published on Tecnimbus — Projects & Demos

