Skip to content

Commit

Permalink
feat: [GROOT-1605] add typing for required taxonomy on content types (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamStokingerContentful authored Feb 6, 2025
1 parent 2cb7b6c commit ff049ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/entities/content-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import type { Snapshot, SnapshotProps } from './snapshot'
import { wrapSnapshot, wrapSnapshotCollection } from './snapshot'
import { omitAndDeleteField } from '../methods/content-type'

type TaxonomyConceptValidationLink = Link<'TaxonomyConcept'> & { required?: boolean }
type TaxonomyConceptSchemeValidationLink = Link<'TaxonomyConceptScheme'> & { required?: boolean }

export type ContentTypeMetadata = {
annotations?: RequireAtLeastOne<
{
Expand All @@ -28,7 +31,7 @@ export type ContentTypeMetadata = {
},
'ContentType' | 'ContentTypeField'
>
taxonomy?: Array<Link<'TaxonomyConcept'> | Link<'TaxonomyConceptScheme'>>
taxonomy?: Array<TaxonomyConceptValidationLink | TaxonomyConceptSchemeValidationLink>
}

export type AnnotationAssignment = Link<'Annotation'> & {
Expand Down

0 comments on commit ff049ea

Please sign in to comment.