Skip to content

Commit

Permalink
provide example for schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ntqdinh-axonivy committed Jul 30, 2024
1 parent fbc3234 commit e3a6f6f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.axonivy.market.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -17,7 +18,9 @@
public class MavenArtifactModel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "Display name and type of artifact", example = "Adobe Acrobat Sign Connector (.iar)")
private String name;
@Schema(description = "Artifact download url", example = "https://maven.axonivy.com/com/axonivy/connector/adobe/acrobat/sign/adobe-acrobat-sign-connector/10.0.25/adobe-acrobat-sign-connector-10.0.25.iar")
private String downloadUrl;
@Transient
private Boolean isProductArtifact;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.axonivy.market.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -16,13 +17,22 @@
public class ProductModuleContent implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "Target release tag", example = "v10.0.25")
private String tag;
@Schema(description = "Product detail description content ", example = "{ \"de\": \"E-Sign-Konnektor\", \"en\": \"E-sign connector\" }")
private Map<String, String> description;
@Schema(description = "Setup tab content", example = "Adobe Sign account creation: An Adobe Sign account needs to be created to setup and use the connector.")
private String setup;
@Schema(description = "Demo tab content", example = "The demo project can be used to test the authentication and signing and the demo implementation can be used as inspiration for development")
private String demo;
@Schema(description = "Is dependency artifact", example = "true")
private Boolean isDependency;
@Schema(example = "Adobe Acrobat Sign Connector")
private String name;
@Schema(description = "Product artifact's group id", example = "com.axonivy.connector.adobe.acrobat.sign")
private String groupId;
@Schema(description = "Product artifact's artifact id", example = "adobe-acrobat-sign-connector-product")
private String artifactId;
@Schema(description = "Artifact file type", example = "iar")
private String type;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.axonivy.market.model;

import com.axonivy.market.entity.MavenArtifactModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -13,6 +14,7 @@
@AllArgsConstructor
@NoArgsConstructor
public class MavenArtifactVersionModel {
@Schema(description = "Target version", example = "10.0.19")
private String version;
private List<MavenArtifactModel> artifactsByVersion;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.axonivy.market.model;

import com.axonivy.market.entity.ProductModuleContent;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
Expand All @@ -11,17 +12,28 @@
@Setter
@NoArgsConstructor
public class ProductDetailModel extends ProductModel {
@Schema(description = "Product vendor", example = "Axon Ivy AG")
private String vendor;
@Schema(description = "Platform review", example = "4.5")
private String platformReview;
@Schema(description = "Latest release version from maven", example = "v10.0.25")
private String newestReleaseVersion;
@Schema(description = "Product cost", example = "Free")
private String cost;
@Schema(description = "Source repository url", example = "https://github.com/axonivy-market/adobe-acrobat-sign-connector")
private String sourceUrl;
@Schema(description = "Status badge url", example = "https://github.com/axonivy-market/adobe-acrobat-sign-connector/actions/workflows/ci.yml/badge.svg")
private String statusBadgeUrl;
@Schema(description = "Default language", example = "English")
private String language;
@Schema(description = "Product industry", example = "Cross-Industry")
private String industry;
@Schema(description = "Compatibility", example = "10.0+")
private String compatibility;
@Schema(description = "Can contact us", example = "false")
private Boolean contactUs;
private ProductModuleContent productModuleContent;
@Schema(description = "Installation/download count", example = "0")
private int installationCount;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
Expand All @@ -19,11 +20,17 @@
@Relation(collectionRelation = "products", itemRelation = "product")
@JsonInclude(Include.NON_NULL)
public class ProductModel extends RepresentationModel<ProductModel> {
@Schema(description = "Product id", example = "jira-connector")
private String id;
@Schema(description = "Product name by locale", example = "{ \"de\": \"Atlassian Jira\", \"en\": \"Atlassian Jira\" }")
private Map<String, String> names;
@Schema(description = "Product's short descriptions by locale", example = "{ \"de\": \"Nutze den Jira Connector von Atlassian, um Jira-Tickets direkt von der Axon Ivy Plattform aus zu verfolgen.\", \"en\": \"Atlassian's Jira connector lets you track issues directly from the Axon Ivy platform\" }")
private Map<String, String> shortDescriptions;
@Schema(description = "Product's logo url", example = "https://raw.githubusercontent.com/axonivy-market/market/feature/MARP-463-Multilingualism-for-Website/market/connector/jira/logo.png")
private String logoUrl;
@Schema(description = "Type of product", example = "connector")
private String type;
@Schema(description = "Tags of product", example = "[\"helper\"]")
private List<String> tags;

@Override
Expand Down

0 comments on commit e3a6f6f

Please sign in to comment.