fsprojects / SwaggerProvider

F# generative Type Provider for Swagger

Home Page:https://fsprojects.github.io/SwaggerProvider/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provider crashes having number at the end of created type name

xperiandri opened this issue · comments

Description

I tried to declare type SambaSafetyQortaV1 = SwaggerProvider.OpenApiClientProvider<"v1.yaml">
And it fails with
FS3057 The type provider 'SwaggerProvider.OpenApiClientTypeProvider' returned an invalid type from 'ApplyStaticArguments'. A type with name 'SambaSafetyQortaV1' was expected, but a type with name 'SambaSafetyQortaV' was returned.

Repro steps

Declare type from type provider with a number at the end

Expected behavior

Type compiles

Actual behavior

Error

Affected Type Providers

  • OpenApiClientProvider

Related information

2.0.0-beta4

@xperiandri can you share v1.yaml or smaller schema with the same error?

By the way it generates nothing from that file

Your schema contains external references, instead of real definitions.

paths:
  /oauth2/v1/token:
    $ref: 'https://api.swaggerhub.com/domains/SambaSafety/Authorization/1.0#/components/token'
  /oauth2/v1/revoke:
    $ref: 'https://api.swaggerhub.com/domains/SambaSafety/Authorization/1.0#/components/revokeToken'

Current TP does not support resolving and loading schema parts.

But why without 1 at the end it is just empty but not display any errors?

Next version(beta) will report proper error that such schemas are not supported