Page Contents

Home > @loopback/openapi-v3 > OASEnhancerService

OASEnhancerService class

An extension point for OpenAPI Spec enhancement This service is used for enhancing an OpenAPI spec by loading and applying one or more registered enhancers.

A typical use of it would be generating the OpenAPI spec for the endpoints on a server in the @loopback/rest module.


export declare class OASEnhancerService 


Constructor Modifiers Description
(constructor)(getEnhancers, options)   Constructs a new instance of the OASEnhancerService class


Property Modifiers Type Description
options? readonly OASEnhancerServiceOptions | undefined (Optional) An extension point should be able to receive its options via dependency injection.
spec   OpenApiSpec Getter for _spec


Method Modifiers Description
applyAllEnhancers(options)   Generate OpenAPI spec by applying ALL registered enhancers TBD: load enhancers by group names
applyEnhancerByName(name)   Apply a given enhancer’s merge function. Return the latest _spec.
getEnhancerByName(name)   Find an enhancer by its name