oatpp / oatpp-swagger

OpenApi 3.0.0 docs + Swagger UI for oatpp services
https://oatpp.io/
Apache License 2.0
91 stars 51 forks source link

Print description for AbstractPairLists #26

Closed natanael closed 3 years ago

natanael commented 3 years ago

Hi,

I noticed that I could not get a info->description for a Field<T> in the oas file. This should fix that.

I also took the chance to move all the AbstractPairList logic to a new method called generateSchemaForAbstractPairList.

It would be super nice to be able to compare OAS before and after and good for testing, but that seemed too complicated to do right now.

Example:

DTO_FIELD_INFO(todoList) {
  info->description = "Task title -> task description";
};
DTO_FIELD(Fields<String>, todoList);
"todoList": {
  "type": "object",
  "description": "Task title -> task description", // <-- This was not showing
  "additionalProperties": {
    "type": "string"
  }
},
lganzzzo commented 3 years ago

Great work! Merged!

lganzzzo commented 3 years ago

Also, I think it will be a good idea to come up with a general method to set common additional info (description + default) for all types.