Skip to content

Commit

Permalink
feat(AsyncAPI 2.6.0): Info object
Browse files Browse the repository at this point in the history
Info object

asyncapi#126
  • Loading branch information
Pakisan committed Feb 7, 2023
1 parent ba2667a commit 2288436
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.asyncapi.v2.model.Tag;
import com.asyncapi.v2.model.channel.ChannelItem;
import com.asyncapi.v2.model.component.Components;
import com.asyncapi.v2.model.info.Info;
import com.asyncapi.v2._6_0.model.info.Info;
import com.asyncapi.v2.model.server.Server;
import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.asyncapi.v2._6_0.model.info;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.annotation.CheckForNull;

/**
* Contact information for the exposed API.
*
* @version 2.6.0
* @see <a href="https://www.asyncapi.com/docs/reference/specification/v2.6.0#contactObject">Contact</a>
* @author Pavel Bodiachevskii
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Contact {

/**
* The identifying name of the contact person/organization.
*/
@CheckForNull
private String name;

/**
* The URL pointing to the contact information. MUST be in the format of a URL.
*/
@CheckForNull
private String url;

/**
* The email address of the contact person/organization. MUST be in the format of an email address.
*/
@CheckForNull
private String email;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.asyncapi.v2._6_0.model.info;

import lombok.*;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;

/**
* The object provides metadata about the API. The metadata can be used by the clients if needed.
*
* @version 2.6.0
* @see <a href="https://www.asyncapi.com/docs/reference/specification/v2.6.0#infoObject">Info</a>
* @author Pavel Bodiachevskii
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Info {

/**
* Required.
* <p>
* The title of the application.
*/
@Nonnull
@NonNull
private String title;

/**
* Required.
* <p>
* Provides the version of the application API (not to be confused with the specification version).
*/
@Nonnull
@NonNull
private String version;

/**
* A short description of the application. CommonMark syntax can be used for rich text representation.
*/
@CheckForNull
private String description;

/**
* A URL to the Terms of Service for the API. MUST be in the format of a URL.
*/
@CheckForNull
private String termsOfService;

/**
* The contact information for the exposed API.
*/
@CheckForNull
private Contact contact;

/**
* The license information for the exposed API.
*/
@CheckForNull
private License license;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.asyncapi.v2._6_0.model.info;

import lombok.*;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;

/**
* License information for the exposed API.
*
* @version 2.6.0
* @see <a href="https://www.asyncapi.com/docs/reference/specification/v2.6.0#licenseObject">License</a>
* @author Pavel Bodiachevskii
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class License {

/**
* Required. The license name used for the API.
*/
@Nonnull
@NonNull
private String name;

/**
* A URL to the license used for the API. MUST be in the format of a URL.
*/
@CheckForNull
private String url;

}

0 comments on commit 2288436

Please sign in to comment.