Hi.
a number of endpoints I created include an enum parameter like this:
[ApiAllowableValues("serv", typeof(eServer))]
[ApiMember(IsRequired = true, AllowMultiple = false, Description = "The Server you will connect to.")]
public eServer serv { get; set; }
Thing is, when generating the openapi.json, eServer
does not appear as a named schema in components/schemas
. I do not want to put this eServer in a wrapper DTO.
Asking some online AI’s gives suggestions like adding:
Plugins.Add(new OpenApiFeature
{
DefaultEnumType = "string", // Use "int" if you prefer numeric values
UseInlineSchemaForEnums = false // Ensures enums are defined globally
});
but those two attributes don’t even exist in my version of ServiceStack (I’m using 6.11.0 atm), neither can I find any documentation that this would exist.
This is problematic for those that consume my services and use NSWAG to generate the object code, as the serv gets duplicated many times over.
Any insights on this? Thx.