Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify PatchSchema and PatchCollection #2401

Open
AndrewSisley opened this issue Mar 11, 2024 · 3 comments
Open

Unify PatchSchema and PatchCollection #2401

AndrewSisley opened this issue Mar 11, 2024 · 3 comments
Labels
area/collections Related to the collections system area/schema Related to the schema system

Comments

@AndrewSisley
Copy link
Contributor

AndrewSisley commented Mar 11, 2024

I think it would be nicer if there is just one entry point for this:

testUtils.SchemaPatch{
	Patch: `
		[
			{ "op": "add", "path": "/Schema/Users/Fields/-", "value": {"Name": "name", "Kind": "String"} },
	                // Make the second collection the active one by moving its name from the first to the second
			{ "op": "move", "from": "/Collections/1/Name", "path": "/Collections/2/Name" }
		]
	`,
},

This may be fairly fiddly to achieve however, for example in the above collection 2 does not exist yet. Have a long think about the dev-ex of this.

for example in the above collection 2 does not exist yet

Although, this problem will exist anyway once we unlock the adding of collections/schema via patches anyway, and might actually already be a problem when adding fields (I cant remember).

@AndrewSisley AndrewSisley added area/schema Related to the schema system area/collections Related to the collections system labels Mar 11, 2024
@fredcarle
Copy link
Collaborator

fredcarle commented Mar 11, 2024

Since we are trying to separate the Schema and Collection within the code base, wouldn't unifying this go against what has been done already?

@AndrewSisley
Copy link
Contributor Author

AndrewSisley commented Mar 11, 2024

Since we are trying to separate the Schema and Collection within the code base, wouldn't unifying this go against what has been done already?

I dont think so, it is one end point, but they are very clearly separate paths (Schema vs Collection). It just means users can submit many commands in a single patch (including test commands).

The name of the endpoint could be PatchDescriptions or something - It could even be extended later to allow the uploading (and modification?) of ACP policies and other stuff.

My biggest concern here is probably that it could obfuscate the order of operations - e.g. to allow the example in the description, schema would need to be processed before collections

@fredcarle
Copy link
Collaborator

You're right. It's the same endpoint but the path is the differentiator. Thanks for pointing that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collections Related to the collections system area/schema Related to the schema system
Projects
None yet
Development

No branches or pull requests

2 participants