polygon-io / issues

Quickly track and report problems with polygon.io
29 stars 0 forks source link

Unable to generate TypeScript and C# clients with: https://polygon.io/docs/swagger.json #39

Closed csmorley closed 1 year ago

csmorley commented 4 years ago

I am trying to generate TypeScript and C# clients with: https://polygon.io/docs/swagger.json

Per https://editor.swagger.io/ I get a stack of errors:

Structural error at definitions.News.properties.keywords.items
should be object
Jump to line 601
Semantic error at definitions.News.properties.keywords.items
`items` must be an object
Jump to line 601
Structural error at definitions.AnalystRatings.properties.strongBuy
should NOT have additional properties
additionalProperty: schema
Jump to line 1088
Structural error at definitions.AnalystRatings.properties.buy
should NOT have additional properties
additionalProperty: schema
Jump to line 1094
Structural error at definitions.AnalystRatings.properties.hold
should NOT have additional properties
additionalProperty: schema
Jump to line 1100
Structural error at definitions.AnalystRatings.properties.sell
should NOT have additional properties
additionalProperty: schema
Jump to line 1106
Structural error at definitions.AnalystRatings.properties.strongSell
should NOT have additional properties
additionalProperty: schema
Jump to line 1112
Semantic error at paths./v2/reference/markets.get.responses.200.schema.properties.results
Schemas with 'type: array', require a sibling 'items: ' field
Jump to line 3112
Semantic error at paths./v2/reference/locales.get.responses.200.schema.properties.results
Schemas with 'type: array', require a sibling 'items: ' field
Jump to line 3161
Structural error at paths./v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}.get.parameters.6
should have required property 'type'
missingProperty: type
Jump to line 3612
Structural error at paths./v1/last/crypto/{from}/{to}.get.responses.200.schema.properties.lastAverage.properties.avg.type
should be equal to one of the allowed values
allowedValues: array, boolean, integer, number, object, string
Jump to line 4740
Structural error at paths./v1/last/crypto/{from}/{to}.get.responses.200.schema.properties.lastAverage.properties.tradesAveraged.type
should be equal to one of the allowed values
allowedValues: array, boolean, integer, number, object, string
Jump to line 4746
Structural error at paths./v1/open-close/crypto/{from}/{to}/{date}.get.responses.200.schema.properties.open.type
should be equal to one of the allowed values
allowedValues: array, boolean, integer, number, object, string
Jump to line 4825
Structural error at paths./v1/open-close/crypto/{from}/{to}/{date}.get.responses.200.schema.properties.close.type
should be equal to one of the allowed values
allowedValues: array, boolean, integer, number, object, string
Jump to line 4831
csmorley commented 4 years ago

As an update, also using autorest https://github.com/Azure/autorest and get the following:

C:\Users\chris\etc\src>autorest --input-file=swagger.json --csharp --out-folder=client --namespace PolygonIo.WebApi

WARNING: AutoRest has not been tested with Node versions greater than v13.

AutoRest code generation utility [cli version: 3.0.6187; node: v14.4.0, max-memory: 8192 gb]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
NOTE: AutoRest core version selected from configuration: ~2.0.4413.
   Loading AutoRest core      'C:\Users\chris\.autorest\@microsoft.azure_autorest-core@2.0.4417\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4417)
   Loading AutoRest extension '@microsoft.azure/autorest.csharp' (~2.3.79->2.3.84)
   Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.55->2.3.55)
ERROR: Schema violation: Data does not match any schemas from 'oneOf'
    - file:///C:/Users/chris/etc/src/swagger.json:1:74681 ($.paths["/v1/open-close/crypto/{from}/{to}/{date}"].get.responses["200"])
ERROR: Schema violation: Data does not match any schemas from 'oneOf'
    - file:///C:/Users/chris/etc/src/swagger.json:1:73360 ($.paths["/v1/last/crypto/{from}/{to}"].get.responses["200"])
ERROR: Schema violation: Data does not match any schemas from 'oneOf'
    - file:///C:/Users/chris/etc/src/swagger.json:1:54524 ($.paths["/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}"].get.parameters)
ERROR: Schema violation: Additional properties not allowed: schema
    - file:///C:/Users/chris/etc/src/swagger.json:1:18197 ($.definitions.AnalystRatings.properties.strongSell)
ERROR: Schema violation: Additional properties not allowed: schema
    - file:///C:/Users/chris/etc/src/swagger.json:1:18102 ($.definitions.AnalystRatings.properties.sell)
ERROR: Schema violation: Additional properties not allowed: schema
    - file:///C:/Users/chris/etc/src/swagger.json:1:18016 ($.definitions.AnalystRatings.properties.hold)
ERROR: Schema violation: Additional properties not allowed: schema
    - file:///C:/Users/chris/etc/src/swagger.json:1:17923 ($.definitions.AnalystRatings.properties.buy)
ERROR: Schema violation: Additional properties not allowed: schema
    - file:///C:/Users/chris/etc/src/swagger.json:1:17826 ($.definitions.AnalystRatings.properties.strongBuy)
FATAL: swagger-document/individual/schema-validator - FAILED
FATAL: Error: [OperationAbortedException] Error occurred. Exiting.
Process() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.