Skip to content

Removing operationId via customizer does not work anymore #2797

Closed
@mb-nick

Description

@mb-nick

Describe the bug

With 2.7.0 it is not possible anymore to remove the operationId via a customizer.
The version we used so far is 2.6.0.
Our customizer looks like this

    @Bean
    public OperationCustomizer operationIdCustomizer() {
        return (operation, handlerMethod) -> {
            operation.setOperationId(null);
            return operation;
        };
    }

The generated operation IDs in the OpenAPI spec are "null_1", "null_2" and so.
With the customizer In 2.6.0 and before the operation ID field was omitted.

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using?
    • 3.4.0
  • What modules and versions of springdoc-openapi are you using?
    • springdoc-openapi-starter-webmvc-ui
    • springdoc-openapi-starter-common

Expected behavior

I expect that, if the operation ID is set to null, that there won't be a field "operationId" for this operation in the generated OpenAPI spec. The field operationId is recommended but not mandatory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions