Skip to content

[REQ] [RUBY] [FARADAY] Allow middleware to be configured #4476

@johngallagher

Description

@johngallagher

Is your feature request related to a problem? Please describe.

I want to instrument all API calls from Open API so I can measure performance.

Describe the solution you'd like

  • When the generator is using Ruby with the Faraday library, I'd like the generated code to allow configuration of middleware
  • It could be as simple as config.use_middlewares: [:instrumentation]
  • Then I could plug in the instrumentation middleware and Faraday does the rest
  • This would allow any middleware to be used and maximise the power of Faraday

Describe alternatives you've considered

  • Overriding the templates - this is messy and means that any changes in the templates will need to be merged into the instrumentation changes
  • Somehow inserting middleware before Faraday is initialized. This isn't currently possible
  • This solution is the most flexible - the config option would only be generated if using the Faraday library and would mean we get maximum flexibility

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions