ru.curs.hurdygurdy.DTOExtractor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hurdy-gurdy Show documentation
Show all versions of hurdy-gurdy Show documentation
Client/server code generator for OpenAPI
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