-
Notifications
You must be signed in to change notification settings - Fork 14
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
MediaConvert CreateJob failing with required property
error
#577
Comments
required property
errorrequired property
error
Hi @RebirthLee , Sorry for the super long response time. This took some time to investigate. Thanks, |
any feedback now? |
Hitting the same issue. |
Same issue |
Hi all, Sorry for the delay. this issue fell off the map. There are many issues with how the While we try to contact the service team for a fix, you can use the following workaround by adding middleware that edits the body raw body with the desired parameter: myMiddleware := middleware.SerializeMiddlewareFunc("MyTestMiddleware",
func(ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler,
) (
output middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := input.Request.(*smithyhttp.Request)
if !ok {
return output, metadata, fmt.Errorf("unexpected transport: %T", input.Request)
}
bodyStream := req.GetStream()
buf := new(strings.Builder)
_, err = io.Copy(buf, bodyStream)
actualBodyString := buf.String()
// the location after which we want to insert the parameter.
substring := `hlsGroupSettings":{`
index := strings.Index(actualBodyString, substring)
newBodyString := actualBodyString[:index+len(substring)] + `"MinSegmentLength":0,` + actualBodyString[len(substring)+index:]
newStream := strings.NewReader(newBodyString)
req.ContentLength = int64(len(newBodyString))
input.Request = req
input.Request, err = req.SetStream(newStream)
if err != nil {
panic(err)
}
return next.HandleSerialize(ctx, input)
})
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithEndpointResolverWithOptions(customResolver), config.WithClientLogMode(aws.LogRequestWithBody|aws.LogResponseWithBody))
if err != nil {
log.Fatalf("unable to load SDK config, %v", err)
}
client := mediaconvert.NewFromConfig(cfg, func(options *mediaconvert.Options) {
options.APIOptions = append(options.APIOptions, func(stack *middleware.Stack) error {
return stack.Serialize.Add(myMiddleware, middleware.After)
})
}) Will result in the following body to be written:
Thanks, |
I have opened a ticket with the service team to address this |
This is now fixed 👍 |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
Link for a similar case to this problem.
Expected Behavior
I want to write 0 value in
MinSegmentLength
field of thetypes.HlsGroupSettings
Current Behavior
operation error MediaConvert: CreateJob, https response error StatusCode: 400, RequestID: 8b703b69-cd87-459b-964e-354dedf42392, BadRequestException: /outputGroups/2/outputGroupSettings/hlsGroupSettings: minSegmentLength is a required property
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go version go1.17.11 darwin/arm64
Operating System and version
osx 12.4
The text was updated successfully, but these errors were encountered: