-
Notifications
You must be signed in to change notification settings - Fork 2
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
Generate code using OpenAPI Specification, update Readme.md, Added 2 test cases. #2
Conversation
…-templates-80 Add Generated Connector Template (Standard)
|
Currently, I have added two test cases and am working on the others too. |
docs/spec/sanitations.md
Outdated
|
||
* Original: `https://api.hubapi.com` | ||
* Updated: `https://api.hubapi.com/crm/v3/objects/discounts` | ||
* Reason: This change is made to ensure that all API paths are relative to the versioned base URL (crm/v3/objects/taxes), which improves the consistency and usability of the APIs. |
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.
* Reason: This change is made to ensure that all API paths are relative to the versioned base URL (crm/v3/objects/taxes), which improves the consistency and usability of the APIs. | |
* Reason: This change is made to ensure that all API paths are relative to the versioned base URL (crm/v3/objects/taxes), which improves the consistency and usability of the APIs. |
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.
Changed
… file notice in types.bal
README.md
Outdated
properties: ["hs_label", "hs_value", "hs_type"] | ||
}; | ||
|
||
CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error response = check hubspotClient->/.get({}, params); |
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.
CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error response = check hubspotClient->/.get({}, params); | |
CollectionResponseSimplePublicObjectWithAssociationsForwardPaging response = check hubspotClient->/.get({}, params); |
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.
Avoid using error
union type when using check
expression
You can read more about check expression here: https://ballerina.io/learn/by-example/check-expression/
Check and update other places.
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.
Resolved.
ballerina/tests/tests.bal
Outdated
CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error response = check hubspotClient->/.get({}, params); | ||
if response is CollectionResponseSimplePublicObjectWithAssociationsForwardPaging { | ||
test:assertNotEquals(response.results, [], "No discounts found"); | ||
test:assertTrue(response.results.length() <= 10, "Limit Exceeded"); | ||
test:assertNotEquals(response.results[0].id, (), "Discount id is not found"); | ||
test:assertNotEquals(response.results[0].properties, (), "Discount properties are not found"); | ||
test:assertNotEquals(response.results[0].properties["hs_type"], (), "Discount label is not found"); | ||
test:assertNotEquals(response.results[0].properties["hs_value"], (), "Discount value is not found"); | ||
test:assertNotEquals(response.results[0].properties["hs_label"], (), "Discount type is not found"); | ||
} else { | ||
test:assertFail("Error occurred while fetching discounts"); | ||
} |
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.
CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error response = check hubspotClient->/.get({}, params); | |
if response is CollectionResponseSimplePublicObjectWithAssociationsForwardPaging { | |
test:assertNotEquals(response.results, [], "No discounts found"); | |
test:assertTrue(response.results.length() <= 10, "Limit Exceeded"); | |
test:assertNotEquals(response.results[0].id, (), "Discount id is not found"); | |
test:assertNotEquals(response.results[0].properties, (), "Discount properties are not found"); | |
test:assertNotEquals(response.results[0].properties["hs_type"], (), "Discount label is not found"); | |
test:assertNotEquals(response.results[0].properties["hs_value"], (), "Discount value is not found"); | |
test:assertNotEquals(response.results[0].properties["hs_label"], (), "Discount type is not found"); | |
} else { | |
test:assertFail("Error occurred while fetching discounts"); | |
} | |
CollectionResponseSimplePublicObjectWithAssociationsForwardPaging response = check hubspotClient->/.get({}, params); | |
test:assertNotEquals(response.results, [], "No discounts found"); | |
test:assertTrue(response.results.length() <= 10, "Limit Exceeded"); | |
test:assertNotEquals(response.results[0].id, (), "Discount id is not found"); | |
test:assertNotEquals(response.results[0].properties, (), "Discount properties are not found"); | |
test:assertNotEquals(response.results[0].properties["hs_type"], (), "Discount label is not found"); | |
test:assertNotEquals(response.results[0].properties["hs_value"], (), "Discount value is not found"); | |
test:assertNotEquals(response.results[0].properties["hs_label"], (), "Discount type is not found"); |
check and update other places.
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.
Other places are checked and resolved.
ballerina/tests/tests.bal
Outdated
test:assertNotEquals(response.results, [], "No discounts found"); | ||
test:assertTrue(response.results.length() <= 10, "Limit Exceeded"); | ||
test:assertNotEquals(response.results[0].id, (), "Discount id is not found"); | ||
test:assertNotEquals(response.results[0].properties, (), "Discount properties are not found"); | ||
test:assertNotEquals(response.results[0].properties["hs_type"], (), "Discount label is not found"); | ||
test:assertNotEquals(response.results[0].properties["hs_value"], (), "Discount value is not found"); | ||
test:assertNotEquals(response.results[0].properties["hs_label"], (), "Discount type is not found"); |
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.
Instead of individually checking and validating these values, can't we compare the entire response with an expected response? if that's possible let's do that. And update the other test cases tool
docs/spec/sanitations.md
Outdated
_Created_: 17th Dec 2024 \ | ||
_Updated_: 19th Dec 2024 \ |
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.
_Created_: 17th Dec 2024 \ | |
_Updated_: 19th Dec 2024 \ | |
_Created_: 2024/12/17 \ | |
_Updated_: 2024/12/17 \ |
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.
Changed.
This PR was closed due to irrelevant commit history. Refer this PR: |
Purpose
Examples
Checklist