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

[W-17756721] fix: add annotation params to prompts #6063

Open
wants to merge 5 commits into
base: feat/apex-oas
Choose a base branch
from

Conversation

peternhale
Copy link
Contributor

@W-17756721@ add annotation params from context to prompts add process step to resolve semantically duplicate paths

@W-17756721@ add annotation params from context to prompts
add process step to resolve semantically duplicate paths
@peternhale peternhale requested a review from a team as a code owner February 6, 2025 21:40
packages/salesforcedx-utils-vscode/src/helpers/utils.ts Outdated Show resolved Hide resolved
@@ -34,6 +34,7 @@
"@stoplight/spectral-rulesets": "1.21.3",
"expand-home-dir": "0.0.3",
"find-java-home": "0.2.0",
"jsonpath-plus": "10.2.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit worried if this can be fully bundled. Will give a try

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw a note on the npm page regarding bundling. It mentioned that bundling for nodejs should be good, but thank you for the "trust but verify" commitment.

@@ -38,7 +38,7 @@ export const sourcePrompts: Prompts = {
' Return only valid YAML output without additional explanations.\n' +
' Ensure compliance with OpenAPI v3 validation rules:\n' +
' - OpenAPI version must be 3.0.0.\n' +
" - Servers should always be a single '/services/apexrest' URL.\n" +
" - The OpenAPI doc servers array property MUST '/services/apexrest' URL.\n" +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that we hard-code the part in oasProcessor, so we will forever have

servers:
  - url: /servers/apexrest

in OAS

is it still necessary to add the statement?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove it, then we can get some tokens back for the response 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the guidance it is still required.

});
}

private resolvePathsThatAreSemanticallyEqual(yaml: OpenAPIV3.Document): OpenAPIV3.Document {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this step to capture what placeholders are on the path and make sure those placeholders have their corresponding parameters in path?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, I think we also need to do vice versa, make sure those parameters in: path show up in the request path

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mingxuanzhangsfdx please log a ticket for the case to make sure those parameters in: path show up in the request path.

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.

3 participants