2

I have to create a rest api from scratch. I have already some experience with Jersey by doing mostly everything manualy.

I wanted to do it right now as this project is new. So I am currently trying the pet store sample that is available every time I am trying an openapi 3.0 online editor.

Using openapi-generator, I have generated the spring boot server for the pet store.

There are a lot of tutorial that will stop there. I don't understand where or how do I have to add my business logic code (database access, ....).

And after that I have a question, how is the specification update is done ?

iXô
  • 1,133
  • 1
  • 16
  • 39

1 Answers1

2

With Spring Framework, you use Repository and Entity classes to handle data layer. And then add Service classes for business logic.

https://www.baeldung.com/spring-component-repository-service

Database (example in MySql): https://spring.io/guides/gs/accessing-data-mysql/

  • 2
    Thanks, I was able to use the delegate mode by setting delegatePattern to true in the openapi generator. – iXô Dec 06 '19 at 16:14