diff --git a/springwolf-ui/src/app/components/schemas/range/schema-range.component.spec.ts b/springwolf-ui/src/app/components/schemas/range/schema-range.component.spec.ts
index f7a4bca2b..7ff60443c 100644
--- a/springwolf-ui/src/app/components/schemas/range/schema-range.component.spec.ts
+++ b/springwolf-ui/src/app/components/schemas/range/schema-range.component.spec.ts
@@ -15,6 +15,8 @@ describe("SchemaRangeComponent", function () {
it("should create the component", async () => {
await renderComponent({
title: "test",
+ name: "test",
+ anchorIdentifier: "test",
minimum: 0.1,
maximum: 10,
exclusiveMinimum: true,
@@ -27,6 +29,8 @@ describe("SchemaRangeComponent", function () {
it("should have `( 0.1 .. 10 )` as value", async () => {
await renderComponent({
title: "test",
+ name: "test",
+ anchorIdentifier: "test",
minimum: 0.1,
maximum: 10,
exclusiveMinimum: true,
@@ -39,6 +43,8 @@ describe("SchemaRangeComponent", function () {
it("should have `[ 0.1 .. 10 )` as value", async () => {
await renderComponent({
title: "test",
+ name: "test",
+ anchorIdentifier: "test",
minimum: 0.1,
maximum: 10,
exclusiveMinimum: false,
@@ -51,6 +57,8 @@ describe("SchemaRangeComponent", function () {
it("should have `( 0.1 .. 10 ]` as value", async () => {
await renderComponent({
title: "test",
+ name: "test",
+ anchorIdentifier: "test",
minimum: 0.1,
maximum: 10,
exclusiveMinimum: true,
@@ -63,6 +71,8 @@ describe("SchemaRangeComponent", function () {
it("should have `[ 0.1 .. 10 ]` as value", async () => {
await renderComponent({
title: "test",
+ name: "test",
+ anchorIdentifier: "test",
minimum: 0.1,
maximum: 10,
});
@@ -73,6 +83,8 @@ describe("SchemaRangeComponent", function () {
it("should have `> 0.1` as value", async () => {
await renderComponent({
title: "test",
+ name: "test",
+ anchorIdentifier: "test",
minimum: 0.1,
exclusiveMinimum: true,
});
@@ -83,6 +95,8 @@ describe("SchemaRangeComponent", function () {
it("should have `< 10` as value", async () => {
await renderComponent({
title: "test",
+ name: "test",
+ anchorIdentifier: "test",
maximum: 10,
exclusiveMaximum: true,
});
@@ -93,6 +107,8 @@ describe("SchemaRangeComponent", function () {
it("should have `>= 0.1` as value", async () => {
await renderComponent({
title: "test",
+ name: "test",
+ anchorIdentifier: "test",
minimum: 0.1,
});
@@ -102,6 +118,8 @@ describe("SchemaRangeComponent", function () {
it("should have `<= 10` as value", async () => {
await renderComponent({
title: "test",
+ name: "test",
+ anchorIdentifier: "test",
maximum: 10,
});
diff --git a/springwolf-ui/src/app/components/schemas/schemas.component.html b/springwolf-ui/src/app/components/schemas/schemas.component.html
index d22ad516a..a6ae42c2e 100644
--- a/springwolf-ui/src/app/components/schemas/schemas.component.html
+++ b/springwolf-ui/src/app/components/schemas/schemas.component.html
@@ -20,7 +20,7 @@
{{ schema.value.title }}
- Title: {{ schema.value.name }}
+ Name: {{ schema.value.name }}
diff --git a/springwolf-ui/src/app/models/schema.model.ts b/springwolf-ui/src/app/models/schema.model.ts
index d42c7fa35..e75041073 100644
--- a/springwolf-ui/src/app/models/schema.model.ts
+++ b/springwolf-ui/src/app/models/schema.model.ts
@@ -2,27 +2,43 @@
import { Example } from "./example.model";
export interface Schema {
- name?: string;
+ /**
+ * Fully qualified schema name
+ */
+ name: string;
+ /**
+ * Short schema name
+ */
title: string;
+ anchorIdentifier: string;
description?: string;
+ deprecated?: boolean;
- refName?: string;
- refTitle?: string;
- anchorIdentifier?: string;
- anchorUrl?: string;
+ enum?: string[];
+ example?: Example;
type?: string;
+ format?: string;
+ // type == ref
+ anchorUrl?: string;
+ refName?: string;
+ refTitle?: string;
// type == object
properties?: { [key: string]: Schema };
+ required?: string[];
// type == array
items?: Schema;
-
- format?: string;
- required?: string[];
- enum?: string[];
- example?: Example;
+ minItems?: number;
+ maxItems?: number;
+ uniqueItems?: boolean;
+ // type == string
+ minLength?: number;
+ maxLength?: number;
+ pattern?: string;
+ // type == number
minimum?: number;
maximum?: number;
exclusiveMinimum?: boolean;
exclusiveMaximum?: boolean;
+ multipleOf?: number;
}
diff --git a/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts b/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts
index 63ee9d51f..a151cfe32 100644
--- a/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts
+++ b/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts
@@ -444,19 +444,28 @@ export class AsyncApiMapperService {
return {
name: schemaName,
title: schemaName.split(".")?.pop() || "undefined-title",
- description: schema.description,
anchorIdentifier: schemaName,
+ description: schema.description,
+ deprecated: schema.deprecated,
+
+ enum: schema.enum,
+ example,
type: schema.type,
- required: schema.required,
format: schema.format,
-
+ // type == object
properties,
+ required: schema.required,
+ // type == array
items,
- enum: schema.enum,
-
- example,
-
+ minItems: schema.minItems,
+ maxItems: schema.maxItems,
+ uniqueItems: schema.uniqueItems,
+ // type == string
+ minLength: schema.minLength,
+ maxLength: schema.maxLength,
+ pattern: schema.pattern,
+ // type == number
minimum: schema.exclusiveMinimum
? schema.exclusiveMinimum
: schema.minimum,
@@ -465,6 +474,7 @@ export class AsyncApiMapperService {
: schema.maximum,
exclusiveMinimum: schema.minimum == schema.exclusiveMinimum,
exclusiveMaximum: schema.maximum == schema.exclusiveMaximum,
+ multipleOf: schema.multipleOf,
};
}
@@ -504,12 +514,12 @@ export class AsyncApiMapperService {
return {
name: schemaName,
title: schemaName.split(".").pop()!!,
+ anchorIdentifier: schemaName,
+ // type == ref
+ anchorUrl: AsyncApiMapperService.BASE_URL + this.resolveRef(schema.$ref),
refName: schema.$ref,
refTitle: this.resolveRef(schema.$ref),
-
- anchorIdentifier: schemaName,
- anchorUrl: AsyncApiMapperService.BASE_URL + this.resolveRef(schema.$ref),
};
}
diff --git a/springwolf-ui/src/app/service/asyncapi/models/schema.model.ts b/springwolf-ui/src/app/service/asyncapi/models/schema.model.ts
index 063142d39..2ef34f5a7 100644
--- a/springwolf-ui/src/app/service/asyncapi/models/schema.model.ts
+++ b/springwolf-ui/src/app/service/asyncapi/models/schema.model.ts
@@ -3,23 +3,36 @@ export type ServerAsyncApiSchemaOrRef = ServerAsyncApiSchema | { $ref: string };
export interface ServerAsyncApiSchema {
description?: string;
- type: string;
- format?: string;
+ deprecated?: boolean;
+
enum?: string[];
+ examples?: any[];
- properties?: {
- [key: string]: ServerAsyncApiSchemaOrRef;
- };
+ type: string;
+ format?: string;
+ // type == ref
+ not?: ServerAsyncApiSchemaOrRef;
allOf?: ServerAsyncApiSchemaOrRef[];
anyOf?: ServerAsyncApiSchemaOrRef[];
oneOf?: ServerAsyncApiSchemaOrRef[];
-
- items?: ServerAsyncApiSchemaOrRef;
- examples?: any[];
-
+ // type == object
+ properties?: {
+ [key: string]: ServerAsyncApiSchemaOrRef;
+ };
required?: string[];
+ // type == array
+ items?: ServerAsyncApiSchemaOrRef;
+ minItems?: number;
+ maxItems?: number;
+ uniqueItems?: boolean;
+ // type == string
+ minLength?: number;
+ maxLength?: number;
+ pattern?: string;
+ // type == number
minimum?: number;
maximum?: number;
exclusiveMinimum?: number;
exclusiveMaximum?: number;
+ multipleOf?: number;
}
diff --git a/springwolf-ui/src/app/service/mock/init-values.ts b/springwolf-ui/src/app/service/mock/init-values.ts
index 206c0b4b6..e5bd12e12 100644
--- a/springwolf-ui/src/app/service/mock/init-values.ts
+++ b/springwolf-ui/src/app/service/mock/init-values.ts
@@ -39,4 +39,6 @@ export const initOperation: Operation = {
export const initSchema: Schema = {
title: "",
+ name: "",
+ anchorIdentifier: "",
};
diff --git a/springwolf-ui/src/main.css b/springwolf-ui/src/main.css
index f1fd44d4f..a0742e304 100644
--- a/springwolf-ui/src/main.css
+++ b/springwolf-ui/src/main.css
@@ -32,6 +32,9 @@ a {
display: flex;
flex-direction: column;
}
+.flex-wrap {
+ flex-wrap: wrap;
+}
.gap-8 {
gap: 8px;
}