-
Notifications
You must be signed in to change notification settings - Fork 408
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
base: feat/apex-oas
Are you sure you want to change the base?
Conversation
@W-17756721@ add annotation params from context to prompts add process step to resolve semantically duplicate paths
@@ -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", |
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.
a bit worried if this can be fully bundled. Will give a try
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.
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.
packages/salesforcedx-vscode-apex/src/oas/generationStrategy/methodByMethodStrategy.ts
Outdated
Show resolved
Hide resolved
@@ -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" + |
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.
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?
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.
If we remove it, then we can get some tokens back for the response 😅
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.
According to the guidance it is still required.
}); | ||
} | ||
|
||
private resolvePathsThatAreSemanticallyEqual(yaml: OpenAPIV3.Document): OpenAPIV3.Document { |
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 step to capture what placeholders are on the path and make sure those placeholders have their corresponding parameters in path?
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.
If so, I think we also need to do vice versa, make sure those parameters in: path show up in the request path
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.
@mingxuanzhangsfdx please log a ticket for the case to make sure those parameters in: path show up in the request path.
Co-authored-by: Mingxuan Zhang <[email protected]>
modified annotation prompt builder to exclude Parameters text when no params
@W-17756721@ add annotation params from context to prompts add process step to resolve semantically duplicate paths