-
Notifications
You must be signed in to change notification settings - Fork 561
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
Exporting YAML OpenAPI spec with SDK Client GetExportCommand results in JSON spec #6090
Comments
Hi @stohlthomas - thanks for reporting. I was able to reproduce this behavior and will be further investigating with the team. AWS CLI
JS v2 & v3 import { APIGatewayClient, GetExportCommand } from "@aws-sdk/client-api-gateway";
import AWS from 'aws-sdk';
// v2 client
const v2Client = new AWS.APIGateway({
region: "us-west-1"
})
const client = new APIGatewayClient({
region: "us-west-1"
});
const input = { // GetExportRequest
restApiId: "bhuovzm968",
stageName: "testStage",
exportType: "oas30",
accepts: "application/yaml",
};
const command = new GetExportCommand(input);
async function v3(){
try {
const response = await client.send(command);
console.log(response)
} catch (error) {
console.log(error)
}
}
v3()
async function v2(){
v2Client.getExport(input, function(err, data) {
if (err) console.log(err, err.stack);
else console.log(data);
});
}
v2()
|
the fix is expected as version https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.580.0 to be released later today |
Thanks for the quick investigation. I pulled v3.580.0 and i am still receiving a json file. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Checkboxes for prior research
Describe the bug
Trying to export with the aws cli is working. However, with this aws-sdk example i am only able to fetch a json specification.
Any help or insights how to debug further is appreciated.
SDK version number
@aws-sdk/client-api-gateway@3.574.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Node 18
Reproduction Steps
Observed Behavior
Json export response
Expected Behavior
Yaml export response
Possible Solution
No response
Additional Information/Context
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/GetExportCommand/
The text was updated successfully, but these errors were encountered: