Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swagger / Openapi with openapi-generator where do we add the business logic code?

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 ?

like image 809
iXô Avatar asked Mar 20 '26 15:03

iXô


1 Answers

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/

like image 92
Zak Bainazarov Avatar answered Mar 23 '26 03:03

Zak Bainazarov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!