Possible to add JavaScript Fetch to REST API endpoint documentation?

Hi! I teach a beginner’s class in HTML, CSS, and JavaScript to college students with no prior programming or technical experience, and I’m looking for a simple way for them to manage their own tiny database and get to the data using a REST API for a final project. Baserow seems to be perfect for this, but I noticed the REST API documentation for JavaScript is in Axios. I’d like to stick with fetch calls so as to stay consistent with my lessons and not to confuse them with importing libraries while they’re learning the basics. Would it be possible to add a basic JavaScript fetch example to the automatically generated API documentation? I’m happy to help with a pull request if it’s in my ability and you don’t have the bandwidth, just send me in the right direction. I don’t have the resources to self host, so this would be an update to the cloud version.

Hey there!

Great to see that Baserow is being used for educational purposes, I can see how we can help to visualise databases for students in a friendly way that might help them understand everything clearer than showing them a database via the command line! Very cool!

If you do have the technical background and would be willing to contribute this change that would be awesome. Every contribution is reviewed by 2 of our team members so you won’t be completely on your own.

In terms of next steps, you would first need to create an issue on GitLab where you outline what you want to do, then you have to fork Baserow and start working on your solution. Once you are done you can push your changes and open a Merge Request and 2 of us will review your MR.

See more details on how to contribute here.

In terms of pointers to help you get started. The change you will have to implement will be in ApiDocsExample.vue, there is a function called getJavaScriptExample which constructs the example for axios. You will want to rename that to something like getAxiosExample and then write another function called getFetchExample.

After that you will have to make sure that both examples show up and maybe add some translation strings but I think you can figure it out from there, otherwise you can always ask for help.

Let me know if we can help with anything else :slight_smile:

1 Like

Awesome - that is a huge help, thank you! I’ll give it a try!

1 Like