All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.curs.hurdygurdy.DTOExtractor Maven / Gradle / Ivy

There is a newer version: 2.01
Show newest version
package ru.curs.hurdygurdy;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.media.Schema;

import java.util.Map;
import java.util.function.BiConsumer;

public abstract class DTOExtractor implements TypeSpecExtractor {

    private final TypeDefiner typeDefiner;

    public DTOExtractor(TypeDefiner typeDefiner) {
        this.typeDefiner = typeDefiner;
    }

    @Override
    public final void extractTypeSpecs(OpenAPI openAPI, BiConsumer typeSpecBiConsumer) {
        for (Map.Entry schemaEntry : openAPI.getComponents().getSchemas().entrySet()) {
            T dto = typeDefiner.getDTO(schemaEntry.getKey(), schemaEntry.getValue(), openAPI);
            typeSpecBiConsumer.accept(ClassCategory.DTO, dto);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy