Skip to content

Commit

Permalink
feat: added implementation of devfileSchema API
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <[email protected]>
  • Loading branch information
olexii4 committed Nov 15, 2022
1 parent 0e64331 commit 63b4552
Show file tree
Hide file tree
Showing 21 changed files with 8,090 additions and 76 deletions.
3 changes: 3 additions & 0 deletions packages/dashboard-backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { registerUserProfileRoute } from './routes/api/userProfile';
import { registerYamlResolverRoute } from './routes/api/yamlResolver';
import { registerFactoryAcceptanceRedirect } from './routes/factoryAcceptanceRedirect';
import { registerWorkspaceRedirect } from './routes/workspaceRedirect';
import { registerDevfileSchemaRoute } from './routes/api/devfileSchema';

export default async function buildApp(server: FastifyInstance): Promise<void> {
const cheHost = process.env.CHE_HOST as string;
Expand Down Expand Up @@ -97,4 +98,6 @@ export default async function buildApp(server: FastifyInstance): Promise<void> {
registerUserProfileRoute(server);

registerYamlResolverRoute(server);

registerDevfileSchemaRoute(server);
}
11 changes: 11 additions & 0 deletions packages/dashboard-backend/src/constants/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@ export const dockerConfigSchema: JSONSchema7 = {
required: ['dockerconfig'],
};

export const devfileVersionSchema: JSONSchema7 = {
type: 'object',
properties: {
version: {
type: 'string',
pattern: '^[1-2]\\.[0-2]\\.[0-2]$',
},
},
required: ['version'],
};

export const yamlResolverSchema: JSONSchema7 = {
type: 'object',
properties: {
Expand Down
Loading

0 comments on commit 63b4552

Please sign in to comment.