-
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
Define new API endpoint + test #17
Conversation
@thomshutt Wondering about repeated requests. How would entire system detect duplicate transcode jobs? Duplicate transcode request can have different callback URL, then we should also call this URL on completion. |
handlers/handlers.go
Outdated
|
||
schema, err := gojsonschema.NewSchema(schemaLoader) | ||
if err != nil { | ||
panic(err) |
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.
Let's handle it a bit more gracefully
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 could move the error on program start and panic early.. let me see how
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.
Fixed please check this commit
|
||
func WriteHTTPBadBodySchema(where string, w http.ResponseWriter, errors []gojsonschema.ResultError) apiError { | ||
sb := strings.Builder{} | ||
sb.WriteString("Body validation error in ") |
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 don't see people use the String Builder very often in Go, normally stuff like this is done with a fmt.Sprintf
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.
Noted.
/api/transcode/file
added tofunc StartCatalystAPIRouter()
gojsonschema
to check input json.OK
for now and invoke callback.