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 Dec 12, 2022
1 parent 013b7c5 commit c0a2737
Show file tree
Hide file tree
Showing 22 changed files with 10,685 additions and 82 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 c0a2737

Please sign in to comment.