-
Notifications
You must be signed in to change notification settings - Fork 116
Generating Schemas from examples #237
Conversation
All the examples are inspected and a common schema is generated.
I was looking into the {
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"example": {
"id": "100",
"createdAt": "2021-06-04T15:50:38.568Z",
"name": "Carol",
"avatar": "https://cdn.fakercloud.com/avatars/nelsonjoyce_128.jpg"
}
}
}
}
}
} Shouldn't the {
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object"
},
"example": {
"id": "100",
"createdAt": "2021-06-04T15:50:38.568Z",
"name": "Carol",
"avatar": "https://cdn.fakercloud.com/avatars/nelsonjoyce_128.jpg"
}
}
}
}
} What I want to point out is wont the Please guide me to the right direction if I'm wrong! |
please check and merge this PR @joolfe |
@Kinjalrk2k I need some time to review but I'm taking it into consideration, thanks so much for the PR. |
This repo lacks an important feature and the MR at least enables basic support for that. However, the repo from @Kinjalrk2k seems outdated and not maintained as well as fails I would really appreciate a solution here and I think other would do too. Maybe the perfection in #246 can be a long term goal, but with intermediate steps (e.g. this MR)? Thanks for everyones effort. This generators saves a lot of work!!! |
@joolfe Are you able to review this PR? |
I created a package that provides a function to create the missing schema types for request bodies and responses based on the examples. I will deprecate the package if the PR is merged but this repository seems pretty dead. |
close because of archive, read the README for more info about that decision. |
Few notable points:
application/json
responses will have a schema.Referencing important issues: