Forum Discussion

arikkfir's avatar
arikkfir
New Member
2 months ago

Setting default values for operation parameters

Hello,

I am integrating Swagger UI in a React app, and trying to apply default values for an operation's path parameter. The default value is computed at runtime, and thus cannot be set in the OpenAPI spec document.

I've been trying to do this via a Plugin, but cannot find a proper spec of exactly what values I should put in the plugin object.

I'm integrating the Swagger UI component like so:

function MyPlugin(system) { 
  return {
    // I HAVE NO IDEA WHAT TO PUT HERE...
  }
)

function MyPage() {
  return (
    <SwaggerUI url="/openapi.yaml"  )
}

I've reviewed the Swagger UI documentation and also looked at the source code, but could not infer what is the correct plug-points to accomplish this.

Help please! 🙏

No RepliesBe the first to reply