io.github.stavshamir.springwolf.configuration.AsyncApiDocket Maven / Gradle / Ivy
Show all versions of springwolf-core Show documentation
package io.github.stavshamir.springwolf.configuration;
import com.asyncapi.v2._6_0.model.info.Info;
import com.asyncapi.v2._6_0.model.server.Server;
import io.github.stavshamir.springwolf.asyncapi.types.ConsumerData;
import io.github.stavshamir.springwolf.asyncapi.types.ProducerData;
import lombok.Builder;
import lombok.Data;
import lombok.NonNull;
import lombok.Singular;
import org.springframework.http.MediaType;
import java.util.List;
import java.util.Map;
/**
* Use to (manually) configure springwolf
*
* This will not be the final AsyncApiDocket, use {@link AsyncApiDocketService#getAsyncApiDocket()} to get it.
* This will not be the final api definition, use {@link io.github.stavshamir.springwolf.asyncapi.AsyncApiService} to get it.
*/
@Data
@Builder
public class AsyncApiDocket {
/**
* The base package containing the declarations of consumers and producer beans.
*/
private final String basePackage;
/**
* Required.
* Provide metadata about the API. The metadata can be used by the clients if needed.
*
* @see Info specification
*/
@NonNull
private final Info info;
/**
* Provides connection details of servers.
*/
@Singular
private final Map servers;
/**
* Provides information about the producers.
*/
@Singular
private final List producers;
@Singular
private final List consumers;
/**
* A string representing the default content type to use when encoding/decoding a message's payload.
*
* @see Default Content Type
*/
@Builder.Default
private final String defaultContentType = MediaType.APPLICATION_JSON_VALUE;
/**
* A string representing the default content type to use when encoding/decoding a message's payload.
*
* @see Identifier
*/
private final String id;
}