diff --git a/README.md b/README.md index c45f0a6..c5eb299 100644 --- a/README.md +++ b/README.md @@ -131,19 +131,30 @@ You can run the application in dev mode using: ## API testing +### 🧪 Sample dataset + +You can find a sample dataset at `docs/sample-dataset/`. Each JSON file contains a collection. + +To load the `moves` collection into an existing MongoDB cluster, you may use [MongoDB Shell ("mongosh")](https://www.mongodb.com/docs/mongodb-shell/) to run +```shell script +mongoimport --uri=mongodb+srv://:@..mongodb.net/ --collection=moves --file=./docs/sample-dataset/moves.json +``` + ### 🏴‍☠️ SwaggerUI Thanks to this project's OpenAPI specs, you can explore the API in a lot of ways. A popular choice is SwaggerUI -- after you run the app, just go to http://localhost:8080/q/swagger-ui and have fun. ⚠️ Unfortunately, Swagger or Quarkus or SmallRye adds the field `id` to all request examples, but in fact ***you should -not include id** when you POST a new document.* +NOT include id** when you POST or UPDATE a new document.* The app takes care of it for you. Same thing for the field `species` with `Pokemong` documents. ### 🩺 API testing tools You can use an API testing tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/) to test this app. +If you use Postman, you can even import `docs/postman_collection.json`, designed to work with the `🧪 Sample dataset`. + ### 📱 Front end (later) Moving forward, the front end part of this app -- a different project -- might also come into play for trying out this