Skip to content

Add more examples to documentation #121

Open
mfvanek opened this issue Apr 11, 2023 · 0 comments
Open

Add more examples to documentation #121

mfvanek opened this issue Apr 11, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@mfvanek
Copy link

mfvanek commented Apr 11, 2023

Hello there,
I'm a newbie in Kora. Past two weeks I've faced with many issue during development of my REST-api app.
It would be great and helpful to extend current Kora documentation with more examples.

  1. Example of POST method with body here
    Like that
    @Json
    @HttpRoute(method = HttpMethod.POST, path = "/books")
    public BookEntity createBook(@Json BookCreationRequest book) {
        LOGGER.info("createBook is called with {}", book);
        return bookRepository.addNewBook(book);
    }
  1. Example of how to customise returned http code of GET/POST endpoint (404, 201 etc.) here
  2. Example of repository that creates new row in database and returns id here
    I mean something like that
    @Query("insert into books(title, author, published_date) values(:title, :author, :publishedDate) returning id")
    int addNewBook(String title, String author, LocalDate publishedDate);
@GoodforGod GoodforGod added the documentation Improvements or additions to documentation label Jul 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants