feat(catalog): add field to the component entity to specify implemented apis per component

This commit is contained in:
Dominik Henneke
2020-07-24 09:06:09 +02:00
parent b5f8aa89b8
commit 7c9e84bd1d
4 changed files with 26 additions and 0 deletions
@@ -0,0 +1,13 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: petstore
description: Petstore
spec:
type: service
lifecycle: experimental
owner: pets@example.com
implementedApis:
- petstore
- streetlights
- hello-world
@@ -35,6 +35,7 @@ describe('ComponentV1alpha1Policy', () => {
type: 'service',
lifecycle: 'production',
owner: 'me',
implementsApis: ['api-0'],
},
};
policy = new ComponentEntityV1alpha1Policy();
@@ -28,6 +28,7 @@ export interface ComponentEntityV1alpha1 extends Entity {
type: string;
lifecycle: string;
owner: string;
implementsApis?: string[];
};
}
@@ -43,6 +44,7 @@ export class ComponentEntityV1alpha1Policy implements EntityPolicy {
type: yup.string().required().min(1),
lifecycle: yup.string().required().min(1),
owner: yup.string().required().min(1),
implementsApis: yup.array(yup.string()).notRequired(),
})
.required(),
});