Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 22 additions & 37 deletions src/schemaValidation/schemas/manifest.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,47 +151,32 @@
}
},
"globalEnvs": {
"oneOf": [
{
"type": "array",
"description": "Request the DAPPMANAGER to inject the selected global ENVs to this package's containers",
"items": {
"type": "object",
"properties": {
"envs": {
"type": "array",
"description": "The list of envs to inject to the defined services",
"items": {
"type": "string",
"examples": [
"_DAPPNODE_GLOBAL_NO_NAT_LOOPBACK",
"_DAPPNODE_GLOBAL_PUBLIC_IP"
]
},
"services": {
"type": "array",
"description": "The services to inject the global ENVs to",
"items": {
"type": "string",
"examples": ["webserver", "backend", "service1"]
}
}
"type": "array",
"description": "Request the DAPPMANAGER to inject the selected global ENVs to this package's containers",
"items": {
"type": "object",
"properties": {
"envs": {
"type": "array",
"description": "The list of envs to inject to the defined services",
"items": {
"type": "string",
"examples": [
"_DAPPNODE_GLOBAL_NO_NAT_LOOPBACK",
"_DAPPNODE_GLOBAL_PUBLIC_IP"
]
},
"services": {
"type": "array",
"description": "The services to inject the global ENVs to",
"items": {
"type": "string",
"examples": ["webserver", "backend", "service1"]
}
}
}
},
{
"type": "object",
"description": "Request the DAPPMANAGER to inject global ENVs to this package's containers",
"properties": {
"all": {
"type": "boolean",
"description": "Request the DAPPMANAGER to inject all available global ENVs",
"examples": ["true"]
}
}
}
]
}
},
"architectures": {
"type": "array",
Expand Down
18 changes: 1 addition & 17 deletions test/schemaValidation/validateSchema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { cleanTestDir, testDir } from "../testUtils";

describe("schemaValidation", () => {
describe("manifest", () => {
it("validateManifest globalEnvs as array of strings", () => {
it("validateManifest globalEnvs as array of objects", () => {
const manifest: Manifest = {
name: "",
version: "1.0.0",
Expand All @@ -36,22 +36,6 @@ describe("schemaValidation", () => {
expect(() => validateManifestSchema(manifest)).to.not.throw();
});

it("validateManifest globalEnvs as object", () => {
const manifest: Manifest = {
name: "",
version: "1.0.0",
description: "",
type: "dncore",
license: "1",
globalEnvs: { all: true },
chain: {
driver: "ethereum"
}
};

expect(() => validateManifestSchema(manifest)).to.not.throw();
});

it("validateManifest chainDriver as string", () => {
const manifest: Manifest = {
name: "",
Expand Down