Ask a Question

Critical Validation Error

ewalker
New Contributor

Critical Validation Error

We were working on adding some new models and endpoints to an API. Everything looked good and while working locally we could use VS Code plugins to render the specs. We went to push up to SwaggerHub using the swaggerhub-cli and started to receive the error "CRITICAL Unable to evaluate definition due to formatting issue". We look in the SwaggerHub UI and there are no errors shown; we try to publish but no luck. We scoured over the formatting and didn't find any issues. We tried commenting out certain properties and it would pass validation, even though there were other properties that were referencing the same model that the commented-out property was using. After more messing around, we started adding extra unused models to see if file length was an issue, and determined that maybe the specs file was too long, we were sitting right around 56,905 lines when we started to get the error. We moved our new endpoints to a new API in SwaggerHub and it rendered fine and had no errors. We don't actually want these endpoints in a separate API than the other existing endpoints, but that is our only workaround at the time because we cannot get past the error. Has anyone else run into this? Are there line length limits? What does the code look like that produces this error, would love to try running it locally?

 

 

3 REPLIES 3
chichepo
Contributor

@ewalker Hi

Indeed, 56K lines is a huge file πŸ˜…

I do work with some big files (app.15k lines) and I have some latency issues depending on the editor (SwaggerHub, Visual Code, OAS editor etc.).

I would suggest to minimize as much as possible the latency issue by working on local editor for example. (You can download it here). Hopefully, the rendering will be better.

Let us know

Thanks, I will give it a shot. It's definitely hard to minimize because our models are fairly large and I can't really reduce those, and we reference those models on different endpoints so the file just grows. I will see what I can do, but I may be stuck with two separate apis. Do you have any insight into the code that produces this error?

@ewalker 
I am not sure about SwaggerHub size limitations (we should wait for Smartbear statement) but in case the swagger file is validated on the client side, it is a known limitation of the web client.

In another circumstances, when you inject 50K lines in a web page and you run a javascript routine that will parse the text, it will give you very weak performances.

cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β