Skip to content

Commit 5010ad7

Browse files
authored
docs: adds swagger and debug info (#613)
1 parent f93dc67 commit 5010ad7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lesson_26/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,21 @@ You can run the server using the usual `./gradlew run` command from the `api/jav
4242
curl http://localhost:3001/items | json_pp
4343
```
4444

45-
Alternatively, you can test the API using the tool [Postman][postman-link]. I recommend installing this tool to make it easier to test things.
45+
The project also includes an OpenAPI user interface (Swagger) for navigating the API. Just visit http://localhost:3001/swagger-ui.html to access it.
46+
47+
Alternatively, you can also test the API using the tool [Postman][postman-link]. I recommend installing this tool to make it easier to test things.
48+
49+
#### Debugging the API
50+
51+
Remember that you can debug the API by visiting the main function in [Lesson26.java][main-file] and clicking `Debug main`. You'll be able to set breakpoints in your code to see what's happening and fix issues.
52+
53+
![Debugging the API](./debug.png)
4654

4755
## Additional resources
4856

4957
* [gRPC vs REST: Comparing API Styles in Practice (Article)](https://dev.to/anthonydmays/grpc-vs-rest-comparing-api-styles-in-practice-4bl): This article explains why the stuff most people call REST isn't actually.
5058

5159
[controller-file]: ./api/java/api_app/src/main/java/com/codedifferently/lesson26/web/MediaItemsController.java
5260
[controller-test-file]: ./api/java/api_app/src/test/java/com/codedifferently/lesson26/web/MediaItemsControllerTest.java
53-
[postman-link]: https://www.postman.com/downloads/
61+
[postman-link]: https://www.postman.com/downloads/
62+
[main-file]: ./api/java/api_app/src/main/java/com/codedifferently/lesson26/Lesson26.java

lesson_26/debug.png

144 KB
Loading

0 commit comments

Comments
 (0)