discord-gophers / goapi-gen

This package contains a set of utilities for generating Go boilerplate code for services based on OpenAPI 3.0 API definitions
Apache License 2.0
137 stars 12 forks source link

refactor: middleware #89

Closed Karitham closed 2 years ago

Karitham commented 2 years ago

This PR refactors the middleware package in such a way that promotes non-breaking changes later on, thus, we could now easily support #79 (presented we actually want that and get to it)

It is also slightly safer, since users can't change the options at runtime, which could have been a tiny issue if it ever happened

Change for REST API consumer: close to none (now doesn't return 500 in case of multiple errors) Change for dev: Slight function signature change

BREAKING: Middleware function signature have changed (as well as their names) FIX: fixes unknown errors due to multierror