Merge pull request #18249 from gabdzo/update-extending-the-model-docs-with-correct-imports-and-get-processor-name-function

Update extending the model docs with correct imports and add getProce…
This commit is contained in:
Fredrik Adelöw
2023-06-14 15:40:15 +02:00
committed by GitHub
@@ -472,8 +472,9 @@ We also provide a high-level example of what a catalog process for a custom
entity might look like:
```ts
import { CatalogProcessor, processingResult } from '@backstage/catalog-backend';
import { entityKindSchemaValidator } from '@backstage/catalog-model';
import { CatalogProcessor, CatalogProcessorEmit, processingResult } from '@backstage/plugin-catalog-node';
import { LocationSpec } from '@backstage/plugin-catalog-common'
import { Entity, entityKindSchemaValidator } from '@backstage/catalog-model';
// For an example of the JSONSchema format and how to use $ref markers to the
// base definitions, see:
@@ -490,6 +491,11 @@ export class FoobarEntitiesProcessor implements CatalogProcessor {
entityKindSchemaValidator(foobarEntityV1alpha1Schema),
];
// Return processor name
getProcessorName(): string {
return 'FoobarEntitiesProcessor'
}
// validateEntityKind is responsible for signaling to the catalog processing
// engine that this entity is valid and should therefore be submitted for
// further processing.