openapi-backend icon indicating copy to clipboard operation
openapi-backend copied to clipboard

String format is not supported

Open sjohnsonaz opened this issue 2 years ago • 8 comments

For a string type, the format field throws the following error:

unknown format "date-time" ignored in schema at path

sjohnsonaz avatar Sep 20 '21 16:09 sjohnsonaz

Hi, i would like to work on this issue. can someone please assign me this issue?

sridhar-5 avatar Oct 01 '21 05:10 sridhar-5

@sridhar-5 done 🙏

anttiviljami avatar Oct 01 '21 05:10 anttiviljami

Thanks. @sjohnsonaz can you please explain a little bit more about the issue, please?

sridhar-5 avatar Oct 01 '21 05:10 sridhar-5

@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

ZimboPro avatar Oct 06 '21 16:10 ZimboPro

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;
                               }});

rehanvdm avatar Oct 21 '21 12:10 rehanvdm

Thanks @rehanvdm for the suggestion, It worked!

tmkasun avatar Dec 02 '21 04:12 tmkasun

Are there any plans to merge this fix in? It seems to work so far.

eriktim avatar Apr 19 '22 11:04 eriktim

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.

newza-fullmetal avatar Jul 03 '23 15:07 newza-fullmetal