Nomics openapi spec is failing validation

Hi there

I am trying to generate a Swift 5 package from the openapi spec, but the document fails the validation. If I override that, it generates a but with numerous errors that do not build. I have tried running it in other languages with the same result.
Here is the output I get from openapi-generator.

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: 32, Warning count: 0
Errors:
-attribute paths.’/exchanges/ticker’(get).parameters.[sort].sort is unexpected
-attribute components.parameters.per-page.[per-page].schemas.min is unexpected
-attribute paths.’/exchanges/ticker’(get).parameters.[convert].convert is unexpected
-attribute paths.’/orders/batches’(get).parameters.[date].date is unexpected
-attribute paths.’/exchange-markets/ticker’(get).parameters.[search].search is unexpected
-attribute paths.’/volume/history’(get).parameters.[start].start is unexpected
-attribute paths.’/volume/history’(get).parameters.[end].end is unexpected
-attribute paths.’/candles’(get).parameters.[start].interval-start is unexpected
-attribute paths.’/currencies/ticker’(get).parameters.[sort].sort is unexpected
-attribute paths.’/candles’(get).parameters.[end].interval-end is unexpected
-attribute paths.’/exchange_candles’(get).parameters.[start].interval-start is unexpected
-attribute paths.’/currencies/ticker’(get).parameters.[platform-currency].platform-currency is unexpected
-attribute paths.’/currencies/ticker’(get).parameters.[convert].convert is unexpected
-attribute paths.’/exchange-markets/ticker’(get).parameters.[status].status is unexpected
-attribute paths.’/exchanges/ticker’(get).parameters.[status].status is unexpected
-attribute paths.’/exchange-markets/ticker’(get).parameters.[interval].default is unexpected
-attribute paths.’/currencies/ticker’(get).parameters.[quote-currency].quote-currency is unexpected
-attribute paths.’/exchange-markets/ticker’(get).parameters.[convert].default is unexpected
-attribute paths.’/orders/snapshot’(get).parameters.[at].at is unexpected
-attribute paths.’/currencies/ticker’(get).parameters.[interval].interval is unexpected
-attribute paths.’/currencies/ticker’(get).parameters.[filter].filter is unexpected
-attribute paths.’/exchanges/ticker’(get).parameters.[type].type is unexpected
-attribute components.schemas.GlobalTickerInterval.items is missing
-attribute paths.’/currencies/ticker’(get).responses.200.content.‘application/json’.schema.items is missing
-attribute paths.’/exchange-markets/ticker’(get).parameters.[sort].sort is unexpected
-attribute paths.’/volume/history’(get).parameters.[convert].convert is unexpected
-attribute paths.’/exchanges/ticker’(get).responses.200.content.‘application/json’.schema.items is missing
-attribute paths.’/exchanges/ticker’(get).parameters.[interval].interval is unexpected
-attribute paths.’/currencies/ticker’(get).parameters.[status].status is unexpected
-attribute components.parameters.per-page.[per-page].schemas.max is unexpected
-attribute components.parameters.page.[page].schemas.min is unexpected
-attribute paths.’/markets/candles’(get).parameters.[start].interval-start is unexpected

at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:554)
at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:581)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:433)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)

There are only two types of errors so this may actually be an easy fix.
Type 1:

-attribute paths.’/exchange-markets/ticker’(get).parameters.[search].search is unexpected

Type 2:

paths.’/currencies/ticker’(get).responses.200.content.‘application/json’.schema.items is missing

Please help, this is quite critical for my project.

Thanks, Paul

Hi Paul, initially we intended for the spec to be usable to generate clients but we ended up only using it to generate documentation, and we didn’t bind it in our server.

So unfortunately we don’t directly support the spec for generating clients. However, our API docs are open source here:

If you submit a PR fixing these issues and it’s fairly simple we are happy to review and merge.

Hi Nick

I guess I don’t have to explain the competitive advantages to your business of having a working openapi spec available, as this opens up your API to many platforms with minimal effort. Of course if you use it yourself, it also guarantees that it is kept up to date with the latest versions of your API.

Be that as it may, I will see if the people at the OpenAPI can assist me in fixing your spec. I am trying to generate a Swift 5 API - the one you advertise on your website is hopelessly incomplete and most of the endpoints are deprecated. If I look at the number of deprecated things in your API, maybe the time is near for a V2 of the API?

Anyhow, I’ll be back.

Cheers, Paul

Yes, that’s why we initially went with the OpenAPI spec but keeping it in sync was more trouble than it was worth. In all these years of v1 you’re the first person to try to use the spec. If it was easier to keep in sync and if there was more demand for it we certainly would have.

And yes, I think it may be time for a v2 :wink:

“In all these years of v1 you’re the first person to try to use the spec.”

Maybe I’m just the first to b*tch about it? Do you have any stats on how many times it’s been downloaded? My approach would have been to use the spec as the source document, and to keep my code compliant, but that’s just me. Anyway, let me see what I can do.

If I fix it and it’s not too much of a hassle I may share it with you. :wink:

Haha yup that’s very possible. Because the api docs code loads the spec as part of the docs I don’t think we can see the difference between folks accessing it on its own. And yes, you’re absolutely using the tech as designed and we are the ones who aren’t providing it as designed. Like I said it just didn’t end up being worth it for us compared to other things. Good luck!

I also can’t use the spec to generate my client. Now I have to invest additonal time to make it working.