openapi-backend
openapi-backend copied to clipboard
String format is not supported
For a string
type, the format
field throws the following error:
unknown format "date-time" ignored in schema at path
Hi, i would like to work on this issue. can someone please assign me this issue?
@sridhar-5 done 🙏
Thanks. @sjohnsonaz can you please explain a little bit more about the issue, please?
@sridhar-5 You can try and use the OpenAPI schema available at https://api.jellyfin.org/ , I think it might be the same error. However, I also get the following error with the schema: unknown format "uuid" ignored in schema at path
Just ue the https://www.npmjs.com/package/ajv-formats, extend he ajv object by doing this (TS):
let api = new OpenAPIBackend({definition: apiPath, quick: true,
customizeAjv:(originalAjv: Ajv, ajvOpts: AjvOpts, validationContext: ValidationContext) =>
{
addFormats(originalAjv)
return originalAjv;
}});
Thanks @rehanvdm for the suggestion, It worked!
Are there any plans to merge this fix in? It seems to work so far.
Hello, still an issue . Is the fix with ajv-format the official way to do it . It forces to depend on an external lib with is abandoned for now.