Skip to content

Can org.eclipse.microprofile.openapi.models.OpenAPI and its "children" return null on getters? #558

Open
@hbelmiro

Description

@hbelmiro

I couldn't find in the docs whether OpenAPI's getters can return null. For example, could the following code throw a NullPointerException?

    private static Optional<Schema> getSchemaRef(String id, OpenAPI openAPI) {
        return Optional.ofNullable(openAPI.getComponents().getSchemas().get(id));
    }

It would be helpful to have it explicitly stated in the #getComponents() and #getSchemas() Javadoc whether they can or cannot return null values, or if it's up to the implementation."

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions