See below screenshot when using pr_set_api_spec, to add Examples.
Within the resulting openapi.json you can see that all the examples are duplicated within the example node for some reason and im guessing that is causing the issue in the UI.
Expected:

Recieved:

Reproduce
pr <- pr() %>%
pr_get(path = "/health-check",
handler = function(msg) {
msg
}) %>%
pr_set_api_spec('./openapi.yaml') %>% pr_run()
openapi.yaml
openapi: 3.0.3
info:
title: Test Examples
description: API Description
version: 0.0.0
paths:
/health-check:
get:
summary: " Determine if the API is running and listening as expected"
responses:
default:
description: Default response.
parameters:
- in: query
name: msg
schema:
type: string
examples: # Multiple examples
one:
value: Hello
summary: Say Hello
two:
value: Goodbye
summary: Say Goodbye
Resulting openapi.json
{
"servers":[
{
"url":""
}
],
"openapi":"3.0.3",
"info":{
"title":"Test Examples",
"description":"API Description",
"version":"0.0.0"
},
"paths":{
"/health-check":{
"get":{
"summary":" Determine if the API is running and listening as expected",
"responses":{
"default":{
"description":"Default response."
}
}
},
"parameters":[
{
"in":"query",
"name":"msg",
"schema":{
"type":"string"
},
"examples":{
"one":{
"value":"Hello",
"summary":"Say Hello"
},
"two":{
"value":"Goodbye",
"summary":"Say Goodbye"
}
},
"example":{
"one":{
"value":"Hello",
"summary":"Say Hello"
},
"two":{
"value":"Goodbye",
"summary":"Say Goodbye"
}
}
}
]
}
}
}
See below screenshot when using
pr_set_api_spec, to add Examples.Within the resulting openapi.json you can see that all the examples are duplicated within the example node for some reason and im guessing that is causing the issue in the UI.
Expected:

Recieved:

Reproduce
openapi.yaml
Resulting openapi.json
{ "servers":[ { "url":"" } ], "openapi":"3.0.3", "info":{ "title":"Test Examples", "description":"API Description", "version":"0.0.0" }, "paths":{ "/health-check":{ "get":{ "summary":" Determine if the API is running and listening as expected", "responses":{ "default":{ "description":"Default response." } } }, "parameters":[ { "in":"query", "name":"msg", "schema":{ "type":"string" }, "examples":{ "one":{ "value":"Hello", "summary":"Say Hello" }, "two":{ "value":"Goodbye", "summary":"Say Goodbye" } }, "example":{ "one":{ "value":"Hello", "summary":"Say Hello" }, "two":{ "value":"Goodbye", "summary":"Say Goodbye" } } } ] } } }