NCATSTranslator / ReasonerAPI

NCATS Biomedical Translator Reasoners Standard API
35 stars 28 forks source link

the refs to outside schema cause errors for BTE #301

Open colleenXu opened 3 years ago

colleenXu commented 3 years ago

the $ref to http://standards.ncats.io/workflow/1.0.0/schema cause errors in BTE (which is using node's api-schema-builder). We've had to comment those sections in order for BTE to handle its smartapi yaml correctly.

Perhaps this is an issue with the package we are using? Or perhaps there is a bit of an issue with how $ref is used here?

marcodarko commented 3 years ago

Specifying the $ref as mentioned above results in an internal error from the SwaggerValidation ("openapi-validator-middleware") and this is what I see (and ultimately returns a null value):

Screen Shot 2021-11-09 at 1 39 39 PM
edeutsch commented 2 years ago

@colleenXu is this still an issue that needs attention?

vdancik commented 2 years ago

@edeutsch , actually, I have encounter the same problem when I switched from 1.3.0-beta to the released TRAPI 1.3.0:

[main] WARN  o.o.codegen.utils.ModelUtils - Failed to get the schema name: #/$defs/OperationAnnotate
[main] ERROR o.o.codegen.utils.ModelUtils - Failed to obtain schema from null
[main] ERROR o.o.codegen.utils.ModelUtils - Failed to obtain schema from null
[main] WARN  o.o.codegen.utils.ModelUtils - Failed to get the schema name: #/$defs/OperationAnnotate
[main] ERROR o.o.codegen.utils.ModelUtils - Failed to obtain schema from null
[main] ERROR o.o.codegen.utils.ModelUtils - Failed to obtain schema from null
[main] WARN  o.o.codegen.utils.ModelUtils - Failed to get the schema name: http://standards.ncats.io/workflow/1.3.2/schema
[main] WARN  o.o.codegen.utils.ModelUtils - Failed to get the schema name: http://standards.ncats.io/workflow/1.3.2/schema
[main] WARN  o.o.codegen.utils.ModelUtils - Failed to get the schema name: http://standards.ncats.io/workflow/1.3.2/schema
[main] WARN  o.o.codegen.utils.ModelUtils - Failed to get the schema name: http://standards.ncats.io/workflow/1.3.2/schema
[main] WARN  o.o.codegen.utils.ModelUtils - Failed to get the schema name: http://standards.ncats.io/workflow/1.3.2/schema
[main] WARN  o.o.codegen.utils.ModelUtils - Failed to get the schema name: http://standards.ncats.io/workflow/1.3.2/schema
Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 1, Warning count: 2

After replacing $ref: http://standards.ncats.io/workflow/1.3.2/schema with $ref: http://standards.ncats.io/workflow/1.0.0/schema the code generator (openapi-generator-cli-5.2.0.jar) worked without an issue.

edeutsch commented 2 years ago

ah, okay, it looks like the schema isn't valid. I'll report over in workflows..

colleenXu commented 2 years ago

Also, I think this is still an issue for us for the same reason Marco mentioned.

We've been commenting out this ref whenever it appears in the TRAPI schema, for our SmartAPI yaml.

edeutsch commented 2 years ago

okay, well, I'm not certain we're all talking the same problem (e.g. Marco posted about 1.0.0) but I'm talking about a problem with 1.3.2. But in case, when 1.3.2 is fixed by the Op&Wf folks, then let's see if that solves everyone's problems.

colleenXu commented 2 years ago

I suspect that it won't since I don't think the issue we have is related to whether the schema is valid or not.

colleenXu commented 2 years ago

Our issue might be how the url is formatted (or our package doesn't work well with $ref to external urls?

https://swagger.io/docs/specification/using-ref/