I am trying to generate a schema dynamically using Spring-Boot when I make a REST API call. For instance, I make a rest call to http://localhost:8080/school
with two different JSON bodies.
Call 1:
{id: 1111, name: "XYZ"}
Call 2:
/school
{id: 1234, name: "ABCD", contact: "test@test.com"}
The request body is transformed into a schema of the table or collection for each request.
table or collection name school
For Call 1
{id: Number, name: String}
I make another API call but pass different JSON body (For Call 2):
table or collection name school
{ id: Number, name: String, contact: String}
Can anyone tell me how to do this, please? I am using MySQL database on the backend.