Customizing OpenAPI Specification

DPSv2 provides a generic OpenAPI specification. This means users must rely on the Schemas API to explore schemas, payload examples, and other details. From the user perspective, this process can be time-consuming and, more importantly, not user-friendly.

To address this, DPSv2 offers a customized API available at /v3/api-docs or through the Swagger UI (usually available at /webjars/swagger-ui/index.html). The customized version modifies the UI so that each generic API (i.e., an API with a settingType parameter) is rewritten to provide a specific API for each setting type.

For example, imagine there is a setting type called ibanplus. The generic API POST /settings-objects/{settingType} would be rewritten as POST /settings-objects/ibanplus. Additionally, all related operations would be grouped under the specific setting type.

The goal of the DPSv2 library is to customize the UI and schemas as much as possible, ensuring the end user requires minimal effort. However, if further adjustments to the OpenAPI specification are needed, it is possible to customize it programmatically:

SettingDefinition.<TestSetting>builder()
    .settingDefinitionOpenAPISpecCustomizer((settingDefinition, openAPI) -> {
        // Customize OpenAPI spec for this setting
    })
    .build();