WPAPI-SwaggerGenerator icon indicating copy to clipboard operation
WPAPI-SwaggerGenerator copied to clipboard

Empty enums

Open anttileppa opened this issue 8 years ago • 2 comments

After Wordpress 4.7 upgrade empty enums appeared into template POST parameters in several enpoints (Page, Post):

e.g.:

{  
  "name":"template",
  "type":"string",
  "in":"formData",
  "description":"Teematiedosto joka n\u00e4ytt\u00e4\u00e4 kohteen.",
  "enum":[
    ""
  ]
}

anttileppa avatar Dec 12 '16 04:12 anttileppa

Is that by design I wonder? I see plenty of other template variables that have an enum list...

I'm not sure what should be here though?

starfishmod avatar Dec 15 '16 23:12 starfishmod

I have also come across this issue. Also I my swagger UI would not display this because of null values. I have written a small fix, maybe you want to add this. https://gist.github.com/RichiWIP/c096f6e7c26a0f5dbcd4e66c650b1f74 I haven't coded PHP for 15 years, so please ignore any rookie mistakes I might have made.

RichiWIP avatar Dec 22 '16 10:12 RichiWIP