-
Couldn't load subscription status.
- Fork 284
[MCP] Added fields section for entities #2916
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
Changes from all commits
1dd9f0f
49e6ec2
aa5472a
3d66a13
16e11fe
c1e43d0
5493ef8
496ca62
e3d5955
efe9d92
474aaf5
84b588b
90388ee
939c038
5921193
de7fc51
49dd3cc
c5558c9
d7253e7
713a1f9
9b2cf6d
6b7f62c
61a0d2d
3de8575
66e5e79
89dd7f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -785,6 +785,21 @@ | |||||
| } | ||||||
| ] | ||||||
| }, | ||||||
| "fields": { | ||||||
| "type": "array", | ||||||
| "description": "Defines the fields (columns) exposed for this entity, with metadata.", | ||||||
| "items": { | ||||||
| "type": "object", | ||||||
| "properties": { | ||||||
| "name": { "type": "string", "description": "Database column name." }, | ||||||
| "alias": { "type": "string", "description": "Exposed name for the field." }, | ||||||
| "description": { "type": "string", "description": "Field description." }, | ||||||
| "primary-key": { "type": "boolean", "description": "Is this field a primary key?" } | ||||||
| }, | ||||||
| "required": ["name"] | ||||||
| }, | ||||||
| "uniqueItems": true | ||||||
| }, | ||||||
| "rest": { | ||||||
| "oneOf": [ | ||||||
| { | ||||||
|
|
@@ -1104,7 +1119,22 @@ | |||||
| } | ||||||
| } | ||||||
| }, | ||||||
| "required": ["source", "permissions"] | ||||||
| "required": ["source", "permissions"], | ||||||
| "allOf": [ | ||||||
| { | ||||||
| "if": { | ||||||
| "required": ["fields"] | ||||||
| }, | ||||||
| "then": { | ||||||
| "not": { | ||||||
| "anyOf": [ | ||||||
| { "required": ["mappings"] }, | ||||||
| { "properties": { "source": { "properties": { "key-fields": { } }, "required": ["key-fields"] } } } | ||||||
|
||||||
| { "properties": { "source": { "properties": { "key-fields": { } }, "required": ["key-fields"] } } } | |
| { "properties": { "source": { "required": ["key-fields"] } } } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,11 @@ public Task AddNewEntityWhenEntitiesEmpty() | |
| cacheTtl: null, | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: null, | ||
| graphQLOperationForStoredProcedure: null | ||
| graphQLOperationForStoredProcedure: null, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
|
Comment on lines
+49
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason to make these parameters empty and not null? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same question applies to the other instances where this change was made. |
||
| ); | ||
|
|
||
| return ExecuteVerifyTest(options); | ||
|
|
@@ -75,7 +79,11 @@ public Task AddNewEntityWhenEntitiesNotEmpty() | |
| cacheTtl: null, | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: null, | ||
| graphQLOperationForStoredProcedure: null | ||
| graphQLOperationForStoredProcedure: null, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| string initialConfiguration = AddPropertiesToJson(INITIAL_CONFIG, GetFirstEntityConfiguration()); | ||
|
|
@@ -107,7 +115,11 @@ public void AddDuplicateEntity() | |
| cacheTtl: null, | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: null, | ||
| graphQLOperationForStoredProcedure: null | ||
| graphQLOperationForStoredProcedure: null, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| string initialConfiguration = AddPropertiesToJson(INITIAL_CONFIG, GetFirstEntityConfiguration()); | ||
|
|
@@ -143,7 +155,11 @@ public Task AddEntityWithAnExistingNameButWithDifferentCase() | |
| cacheTtl: null, | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: null, | ||
| graphQLOperationForStoredProcedure: null | ||
| graphQLOperationForStoredProcedure: null, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| string initialConfiguration = AddPropertiesToJson(INITIAL_CONFIG, GetFirstEntityConfiguration()); | ||
|
|
@@ -174,7 +190,11 @@ public Task AddEntityWithCachingEnabled() | |
| cacheTtl: "1", | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: null, | ||
| graphQLOperationForStoredProcedure: null | ||
| graphQLOperationForStoredProcedure: null, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| return ExecuteVerifyTest(options); | ||
|
|
@@ -211,7 +231,11 @@ public Task AddEntityWithPolicyAndFieldProperties( | |
| cacheEnabled: null, | ||
| cacheTtl: null, | ||
| restMethodsForStoredProcedure: null, | ||
| graphQLOperationForStoredProcedure: null | ||
| graphQLOperationForStoredProcedure: null, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| // Create VerifySettings and add all arguments to the method as parameters | ||
|
|
@@ -244,7 +268,11 @@ public Task AddNewEntityWhenEntitiesWithSourceAsStoredProcedure() | |
| cacheEnabled: null, | ||
| cacheTtl: null, | ||
| restMethodsForStoredProcedure: null, | ||
| graphQLOperationForStoredProcedure: null | ||
| graphQLOperationForStoredProcedure: null, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| return ExecuteVerifyTest(options); | ||
|
|
@@ -276,7 +304,11 @@ public Task TestAddStoredProcedureWithRestMethodsAndGraphQLOperations() | |
| cacheTtl: null, | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: new string[] { "Post", "Put", "Patch" }, | ||
| graphQLOperationForStoredProcedure: "Query" | ||
| graphQLOperationForStoredProcedure: "Query", | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| return ExecuteVerifyTest(options); | ||
|
|
@@ -304,7 +336,11 @@ public void AddEntityWithDescriptionAndVerifyInConfig() | |
| cacheTtl: null, | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: null, | ||
| graphQLOperationForStoredProcedure: null | ||
| graphQLOperationForStoredProcedure: null, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| string config = INITIAL_CONFIG; | ||
|
|
@@ -359,7 +395,11 @@ public void TestAddNewEntityWithSourceObjectHavingValidFields( | |
| cacheTtl: null, | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: null, | ||
| graphQLOperationForStoredProcedure: null | ||
| graphQLOperationForStoredProcedure: null, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| RuntimeConfigLoader.TryParseConfig(INITIAL_CONFIG, out RuntimeConfig? runtimeConfig); | ||
|
|
@@ -419,7 +459,11 @@ public Task TestAddNewSpWithDifferentRestAndGraphQLOptions( | |
| cacheTtl: null, | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: restMethods, | ||
| graphQLOperationForStoredProcedure: graphQLOperation | ||
| graphQLOperationForStoredProcedure: graphQLOperation, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| VerifySettings settings = new(); | ||
|
|
@@ -455,7 +499,11 @@ public void TestAddStoredProcedureWithConflictingRestGraphQLOptions( | |
| cacheTtl: null, | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: restMethods, | ||
| graphQLOperationForStoredProcedure: graphQLOperation | ||
| graphQLOperationForStoredProcedure: graphQLOperation, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| RuntimeConfigLoader.TryParseConfig(INITIAL_CONFIG, out RuntimeConfig? runtimeConfig); | ||
|
|
@@ -494,7 +542,11 @@ public void TestAddEntityPermissionWithInvalidOperation(IEnumerable<string> perm | |
| cacheTtl: null, | ||
| config: TEST_RUNTIME_CONFIG_FILE, | ||
| restMethodsForStoredProcedure: null, | ||
| graphQLOperationForStoredProcedure: null | ||
| graphQLOperationForStoredProcedure: null, | ||
| fieldsNameCollection: [], | ||
| fieldsAliasCollection: [], | ||
| fieldsDescriptionCollection: [], | ||
| fieldsPrimaryKeyCollection: [] | ||
| ); | ||
|
|
||
| RuntimeConfigLoader.TryParseConfig(INITIAL_CONFIG, out RuntimeConfig? runtimeConfig); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a question for someone? I think we should change this description