Forum Discussion

paladinzhy's avatar
paladinzhy
Occasional Visitor
5 months ago

Retrieve model properties in operation layer

Hi guys,

I'm relatively new to the OpenAPI Generator, and I'm eager to create a customized generator that can generate a web page featuring operation forms. My goal is to have each form dynamically populated with fields based on the properties of the operation model.

While working in the operation layer, I've successfully retrieved the body parameter for a given operation. However, I'm currently facing a challenge in obtaining the properties of this body parameter's datatype. For instance, let's take the "createUser" endpoint, where the body parameter is of type "User" with properties like userId and userName.

I'm curious if there's a general method or approach to retrieve these model properties directly within the operation layer (using {{#operations}} {{/operations}}). Specifically, I'm looking for a way to obtain the field names (e.g., userId and userName) along with their corresponding datatypes.

Any guidance on this matter would be greatly appreciated!

No RepliesBe the first to reply