@ -214,29 +357,61 @@ You can run the application in dev mode using:
### 🧪Sample dataset
### 🧪Sample dataset
You can find a sample dataset at `docs/sample-dataset/`. Each JSON file contains a collection.
<details><summary>🏫 If you are the corrector</summary>
Please navigate to the root of this project in a terminal and run the provided `load_data.sh` script.
If the script wasn't provided, that was a mistake. Sorry. Please request them to the owner of this repo, or follow the
alternate
procedure below.
</details>
<details><summary>👥 If you are another user or developer</summary>
You can find a sample dataset at `data/sample-dataset/`. Each JSON file contains a collection.
For example, 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
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
You can then do the same, but changing `moves` for `pokemongs`, and then `trainers`
Thanks to this project's OpenAPI specs, you can explore the API in a lot of ways.
</details>
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 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
### 🩺API testing tools
You can use an API testing tool such as [Postman](https://www.postman.com/)
You can use an API testing tool such as [Postman](https://www.postman.com/)
or [Insomnia](https://insomnia.rest/) to test this app.
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`.
If you use Postman, you can even import `data/postman_collection.json`, designed to work with the `🧪 Sample dataset`.
### 📱Front end
A corresponding [front-end app](https://github.com/draialexis/pokemong_app) comes into play for trying out this API.
⚠️ That only includes the `Move` entity, so [`Postman`](#api-testing-tools) seems like your best option at the moment.
### 🏴☠️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.
⚠️ Swagger or Quarkus or SmallRye adds the field `id` to all request examples, but in fact
***you should 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.
## Known limitations
### 🔀Types are left at the user's mercy
### 📱Front end (later)
This API doesn't ensure that *a `Move` can't be both effective against a type and weak against that type*. It probably
should.
Moving forward, the front end part of this app -- a different project -- might also come into play for trying out this
But then again, this API doesn't deal with types very much at all anyway. Users are free to create all sorts of weird
API.
types within `pokemongs` and `moves`, such as a Pikachu with `GRASS` type effective against `ROCK`, who has an Ember
move with `GRASS` type weak against `ROCK` and effective against `FLYING`...