• Blake Mizerany's avatar
    llm: do not silently fail for supplied, but invalid formats (#8130) · 87f0a49f
    Blake Mizerany authored
    Changes in #8002 introduced fixes for bugs with mangling JSON Schemas.
    It also fixed a bug where the server would silently fail when clients
    requested invalid formats. It also, unfortunately, introduced a bug
    where the server would reject requests with an empty format, which
    should be allowed.
    
    The change in #8127 updated the code to allow the empty format, but also
    reintroduced the regression where the server would silently fail when
    the format was set, but invalid.
    
    This commit fixes both regressions. The server does not reject the empty
    format, but it does reject invalid formats. It also adds tests to help
    us catch regressions in the future.
    
    Also, the updated code provides a more detailed error message when a
    client sends a non-empty, but invalid format, echoing the invalid format
    in the response.
    
    This commits also takes the opportunity to remove superfluous linter
    checks.
    87f0a49f
server_test.go 1.56 KB