From 60f4e0085aaa179816fb6a300ca165d32ff7f553 Mon Sep 17 00:00:00 2001 From: Alexis Drai Date: Fri, 2 Jun 2023 11:27:33 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20Readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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