Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Typesense/Collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export interface CollectionUpdateSchema
extends Partial<Omit<CollectionCreateSchema, "name" | "fields">> {
fields?: (CollectionFieldSchema | CollectionDropFieldSchema)[];
synonym_sets?: string[];
curation_sets?: string[];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CollectionUpdateSchema already picks this up transitively via Partial<Omit<CollectionCreateSchema, "name" | "fields">>, because CollectionCreateSchema is based on BaseCollectionCreateSchema, which already includes curation_sets. So adding curation_sets directly on CollectionUpdateSchema is redundant.

TypeScript interface declaration merging means redeclaring the same property here won’t necessarily break anything, but it still doesn’t add new type information and makes the schema definition harder to reason about.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I should have double checked the types. Looking back synonym_sets also seems redundant here.
Should I remove that as well from the extended type or leave it for now and just remove the update I have done?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you could remove it, I would appreciate it. It doesn't hurt being here, but removing it cleans redundant declarations!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, I have removed the redundant types and pushed the changes

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tharropoulos LMK if you need any more changes to be done on the PR or if it's okay to be merged

}

export interface CollectionDeleteOptions {
Expand Down