Skip to content

Allow custom schemas using IDataSourceSchemaProvider#40

Open
ThomasBleijendaal wants to merge 1 commit intoSamuelFisher:masterfrom
ThomasBleijendaal:schema-builder
Open

Allow custom schemas using IDataSourceSchemaProvider#40
ThomasBleijendaal wants to merge 1 commit intoSamuelFisher:masterfrom
ThomasBleijendaal:schema-builder

Conversation

@ThomasBleijendaal
Copy link
Copy Markdown
Contributor

This PR adds IDataSourceSchemaProvider which is an interface that allows plugins to provide custom schemas that are not bound to a specific concrete type. One can output a schema containing objects with certain properties, but use an type that receives those properties in something like Dictionary<string, Dictionary<string, object>>.

I don't know if you want to go this direction with this plugin, but this allows for creating a bunch of specialized schemas, but handle those using a single type.

A use case for this is, for example, create a terraform plugin that reads a certain folder for specific files, parse those files, and output a schemas for each file, containing properties from those files. Those files can then be referenced in the terraform template, and the code suggestions will reflect those exact files and their contents.

@SamuelFisher SamuelFisher self-requested a review August 23, 2023 17:31
@ThomasBleijendaal
Copy link
Copy Markdown
Contributor Author

On second thought, we might want to make the IDataSourceSchemaProvider.GetSchema async. That requires some more rework in the ResourceRegistry, but that makes creating dynamic schemas more easy when dealing with IO. What do you think?

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