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.

Signature:

export declare class OASEnhancerService 

Constructors

Constructor Modifiers Description
[(constructor)(getEnhancers, options)](/doc/en/lb4/apidocs.openapi-v3.oasenhancerservice._constructor_.html) Constructs a new instance of the `OASEnhancerService` class

Properties

Property Modifiers Type Description
[options?](/doc/en/lb4/apidocs.openapi-v3.oasenhancerservice.options.html) `readonly` [OASEnhancerServiceOptions](/doc/en/lb4/apidocs.openapi-v3.oasenhancerserviceoptions.html) \| undefined _(Optional)_ An extension point should be able to receive its options via dependency injection.
[spec](/doc/en/lb4/apidocs.openapi-v3.oasenhancerservice.spec.html) [OpenApiSpec](/doc/en/lb4/apidocs.openapi-v3.openapispec.html) Getter for `_spec`

Methods

Method Modifiers Description
[applyAllEnhancers(options)](/doc/en/lb4/apidocs.openapi-v3.oasenhancerservice.applyallenhancers.html) Generate OpenAPI spec by applying ALL registered enhancers TBD: load enhancers by group names
[applyEnhancerByName(name)](/doc/en/lb4/apidocs.openapi-v3.oasenhancerservice.applyenhancerbyname.html) Apply a given enhancer's merge function. Return the latest \_spec.
[getEnhancerByName(name)](/doc/en/lb4/apidocs.openapi-v3.oasenhancerservice.getenhancerbyname.html) Find an enhancer by its name