Swagger $select

Hi,

Is it possible to have an input for a $select in swagger?

Thanks,

Ken

Great question! Looks like we need the ability to add an "enum" property to wherever a string value is defined as part of the parameter?

I think the swagger.json that is generated would be the place to change if it adding "enum" isn't possible using the built-in mechanisms, but I don't see where we can make changes to swagger.json either - it seems to be generated when the app is compiled but doesn't reflect subsequent changes in the XML files.

Maybe whatever is being done by LoadXMLDoc(model) can be subsequently altered in code? We can already do this to add a title/description, so maybe just drilling down into that data structure would allow us to add any missing "enum" property and its values?

I'm not sure exactly what is being requested here? I understand that @Randall_Ken is asking for a free-typing edit box for $select value in every endpoint in Swagger that refers to a list (as there is now for $filter, $top, etc.?

And @AndrewSimard is asking for a combobox in such field to display valid field names?

Sorry, I took what he was asking as a request to have Swagger parameters presented as a <select> component on the page, so the user can pick something from a list rather than an ad-hoc text input field where an invalid option could be entered... but I likely misunderstood the reference to the $select part, being as I don't have any experience with the Aurelius query language stuff.

Yes, but the $select field is not an enum, but a comma-separated list of field names, like Id,Name,City. I believe Swagger enum is just for a single value.

Right, so perhaps I should make this a separate feature request? Or is there a way to define a parameter in an XData endpoint that will be an enum in Swagger rather than a string? For example, if I've got a "format" parameter as a string, but with expected values of "JSON", "CSV" and "XLS", it would be nice to have those as choices in a combobox in Swagger rather than a string field. But maybe I can define a different parameter in XData already to do that? Can't say I've tried, honestly, just that I liked the idea as soon as I (mis)read his post :slight_smile:

And apologies to Ken for messing up his question!

No problem Andrew :grinning:

If the Delphi type is an enumerated type, then it will be an enumerated in Swagger.

1 Like

@Randall_Ken, can you please file a feature request so we can better track this? Thank you in advance.

Done. Please see https://support.tmssoftware.com/t/add-select-query-option-to-swagger/20664

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.