Skip to content

feat: add method to merge (top-level) schemas#179

Open
tobikris wants to merge 1 commit intoinvopop:mainfrom
exaring:merge
Open

feat: add method to merge (top-level) schemas#179
tobikris wants to merge 1 commit intoinvopop:mainfrom
exaring:merge

Conversation

@tobikris
Copy link
Copy Markdown

We want to generate schema definitions for a type using generics.

Combining multiple parts by embedding is not working in this case though:

embedded field type cannot be a (pointer to a) type parameter (MisplacedTypeParam)

type CommonConfig struct {
	ServiceName string
}

type CombinedConfig[C any] struct {
	CommonConfig // this works
	C            // this does not
}

type CustomConfig struct {
	Foo string
}

This merge method achieves the same goal and seemed to be helpful in more than just our case.

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.

1 participant