Skip to content

Conversation

@dontlaugh
Copy link
Contributor

These will be populated after additional work on the backend

@dontlaugh
Copy link
Contributor Author

dontlaugh commented Jan 14, 2026

New types will need to be introduced into this library before backend changes.
image

https://github.com/SchematicHQ/schematic-api/pull/3352

@dontlaugh dontlaugh marked this pull request as ready for review January 14, 2026 18:15
models.go Outdated
Traits []*Trait `json:"traits"`
Rules []*Rule `json:"rules"`
mu sync.Mutex `json:"-"` // mutex for thread safety
Entitlements []*FeatureEntitlement `json:"entitlements"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should this be tagged with omitempty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bpapillon I think the original design was to have a map[string]*FeatureEntitlement here; I would strongly recommend we use a slice, though. It will be more flexible for us in the long run.

Copy link
Contributor

Choose a reason for hiding this comment

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

I went back and forth on this - in practice, we would probably create a map in memory regardless, because we're going to be checking entitlements by a flag key, so we'd set up the data structure for that to be O(1). But I agree that this is more flexible and that is the tradeoff.

wyt about that @cbrady ?

also, yes I would likely omitemty this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added omitempty

@dontlaugh dontlaugh requested a review from cbrady January 14, 2026 20:18
@dontlaugh dontlaugh requested a review from bpapillon January 15, 2026 00:06

type FeatureEntitlement struct {
FeatureID string `json:"feature_id"`
FeatureKey string `json:"feature_key"`
Copy link
Contributor

Choose a reason for hiding this comment

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

is this the flag key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a term that Ben came up with for flag/feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

not a blocker for me but i feel like because we're going to be matching flags to this value we should call it flag key.

@dontlaugh dontlaugh merged commit 1d83e47 into main Jan 15, 2026
2 checks passed
@dontlaugh dontlaugh deleted the new-types-schy-9 branch January 15, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants