cancel
Showing results for 
Search instead for 
Did you mean: 

Super beginner question :)

SOLVED
Highlighted
New Contributor

Super beginner question :)

Dear friends,

<preamble>

in real life I am a medical doctor and as my dark secret I do some programming to take a break from my main job and "distract" myself from it.

I have been playing with OpenAPI a little and find the whole concept of "API first" programming really attractive.

I my probably limited understanding if I take some time to define the APIs and the related data model I can then ensure that BOTH the backend and front-end developers rely on that to develop their stuff right?

For the backend I've been generating flask-servers and using an Atlas MongoDB and all is cute and fine. 

</preamble>

What I'm trying to understand is if there's a toolchain to speed up a front-end development coherent with the API and its data model.

Currently I'm just using the datamodel to build forms and stuff like that but if I did change something in the API or datamodel I currently have to manually review the forms to be sure they reflect the new data.

Is it possible if not automating at least to help in this fronted to API/model consistency?

Hope this is not too dumb a question. Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

Re: Super beginner question :)

It depends on the version of the codegen that you use (which depends on the version of specification you use). You can take a look at https://github.com/swagger-api/swagger-codegen#modifying-the-client-library-format and the following header to learn how to customize the codegen. There *are* html/js templates, but they may not suit your needs. However, you can take a look at them and use them as a baseline.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

4 REPLIES 4
Highlighted
Moderator

Re: Super beginner question :)

Very valid question.

 

Generally speaking, you can use code generators like Swagger Codegen to automate the process of creating boilerplate code. Note that the existing templates may not address your needs out of the box. However, since the templates are highly customizable, you can simply modify them to your own needs and keep using them.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Highlighted
New Contributor

Re: Super beginner question :)

Well thanks for letting me know I'm not totally misunderstanding 🙂

I use Codegen to generate the Flask backend but could not find/understand how to use it to also generate a "boilerplate" of an HTML/JS frontend ... is this possible? Can you suggest some  further reading/ideas?

 

Take care

Highlighted
Moderator

Re: Super beginner question :)

It depends on the version of the codegen that you use (which depends on the version of specification you use). You can take a look at https://github.com/swagger-api/swagger-codegen#modifying-the-client-library-format and the following header to learn how to customize the codegen. There *are* html/js templates, but they may not suit your needs. However, you can take a look at them and use them as a baseline.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

Highlighted
New Contributor

Re: Super beginner question :)

Thanks a lot! Will study 🙂

Even in my beginner's understanding I see how Smartbear's products and architecture caters for robust API design and implementation but also feel that if I'm not also facilitating the front-end developers the idea of API First philosophy might be weakened.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors