-
Notifications
You must be signed in to change notification settings - Fork 97
Add query parameters section to creating data services documentation #2176
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -95,6 +95,37 @@ In this step, you can configure a REST resource to invoke the data service. | |||||
|
|
||||||
| <a href="{{base_path}}/assets/img/integrate/tutorials/data_services/resource-graphical-view.png" class="glightbox"><img src="{{base_path}}/assets/img/integrate/tutorials/data_services/resource-graphical-view.png" width="80%"></a> | ||||||
|
|
||||||
| ## Add query parameters to a resource | ||||||
|
|
||||||
| Query parameters allow you to filter or customize the data returned by a resource | ||||||
| using URL parameters in the format `?param=value`. | ||||||
|
|
||||||
| Follow the steps below to add a query parameter to a data service resource. | ||||||
|
|
||||||
| 1. In the **Data Service Designer**, click the resource you created under **Resources**. | ||||||
|
Contributor
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. Inconsistent UI terminology. This line references "Data Service Designer", but the same UI component is called "Service Designer" elsewhere in the document (lines 33, 90). Use consistent terminology throughout. 📝 Proposed fix for terminology consistency-1. In the **Data Service Designer**, click the resource you created under **Resources**.
+1. In the **Service Designer**, click the resource you created under **Resources**.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| 2. Click **Query** in the DataService view to open the query configuration. | ||||||
|
|
||||||
| 3. In the **Query / Expression** field, write your SQL query using a named variable. | ||||||
| For example, to filter employees by department: | ||||||
| ```sql | ||||||
| SELECT EmployeeNumber, FirstName, LastName FROM Employees WHERE Department=:dept_name | ||||||
| ``` | ||||||
|
|
||||||
| 4. Click **Input Mapping** in the DataService view to open the input mapping configuration. | ||||||
|
|
||||||
| 5. Click **+ Add Parameter** and fill in the following details: | ||||||
|
|
||||||
| | Field | Value | | ||||||
| |---------------|--------------------| | ||||||
| | Parameter Name | `dept_name` | | ||||||
| | Parameter Type | `QUERY` | | ||||||
| | SQL Type | `STRING` | | ||||||
|
|
||||||
| 6. Click **Save** to save the input mapping, then click **Submit** to apply. | ||||||
|
|
||||||
| The resource can now be invoked with a query parameter: | ||||||
|
Contributor
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. Missing invocation example. Line 127 states "The resource can now be invoked with a query parameter:" but no example follows. The PR description mentions including "A sample curl/URL invocation example." Provide the promised example. 📝 Suggested additionAdd an example after line 127, such as: ```bash
curl http://localhost:8290/services/YourDataService/resource?dept_name=Engineeringor invoke via browser: Verify each finding against the current code and only fix it if needed. In |
||||||
|
|
||||||
| ### Add a SOAP operation | ||||||
|
|
||||||
| In this step you can configure a SOAP operation for invoking the data service. | ||||||
|
|
@@ -328,4 +359,4 @@ You can use a sample template to create your data service. | |||||
| 1. Go to **Explore Samples** in MI for VS Code. | ||||||
| 2. In the **Samples** tab, go to the **REST Data Service** and click on **Download**. This will download the project to your chosen directory and open it in a new VS Code window. | ||||||
|
|
||||||
| For more information | ||||||
| For more information | ||||||
|
Contributor
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. Incomplete documentation text. Line 362 contains "For more information" without completion. Either complete this sentence with a relevant link or reference, or remove it if added unintentionally. 🤖 Prompt for AI Agents |
||||||
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.
Fix heading level to match document structure.
This section uses
##(level 2), making it equivalent to "Tutorials" and "Examples". However, according to the PR description, this should be a subsection under "Add a resource" (which uses###). Use####to create a proper subsection hierarchy.📝 Proposed fix for heading level
🤖 Prompt for AI Agents