Skip to content

kiota 1.9.0 behaves strangely when generating for try.gitea swagger.v1.json #3901

Closed

Description

When I run:

KIOTA_TUTORIAL_ENABLED=false kiota generate -l CSharp -d https://try.gitea.io/swagger.v1.json -o GiteaClient/ -c GiteaClient -n Mir.ClassLib.GiteaClient --ebc

For version 1.8.2 I get this:

warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/ - Multiple servers entries were found in the OpenAPI description. Only the first one will be used. The root URL can be set manually with the request adapter.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/CommitUser/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/CreateUserOption/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/EditUserOption/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/Email/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/Identity/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/PayloadUser/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/PullReviewComment/properties/original_position - The format uint64 is not supported by Kiota for the type integer and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/PullReviewComment/properties/position - The format uint64 is not supported by Kiota for the type integer and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/User/properties/email - The format email is not supported by Kiota and the string type will be used.
fail: Kiota.Builder.KiotaBuilder[0]
      OpenAPI error: #/paths//repos/{owner}/{repo}/git/commits/{sha}.{diffType} - The path signature '/repos/{}/{}/git/commits/{}' MUST be unique.
fail: Kiota.Builder.KiotaBuilder[0]
      OpenAPI error: #/paths//repos/{owner}/{repo}/pulls/{index}.{diffType} - The path signature '/repos/{}/{}/pulls/{}' MUST be unique.
warn: Kiota.Builder.KiotaBuilder[0]
      Omitted property reason for model WatchInfo in API path \repos\{owner}\{repo}\subscription, the schema is invalid.
warn: Kiota.Builder.KiotaBuilder[0]
      Omitted property content for model FileDeleteResponse in API path \repos\{owner}\{repo}\contents\{filepath}, the schema is invalid.
Generation completed successfully

For version 1.9.0 I get this:

warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/ - Multiple servers entries were found in the OpenAPI description. Only the first one will be used. The root URL can be set manually with the request adapter.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/CommitUser/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/CreateUserOption/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/EditUserOption/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/Email/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/Identity/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/PayloadUser/properties/email - The format email is not supported by Kiota and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/PullReviewComment/properties/original_position - The format uint64 is not supported by Kiota for the type integer and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/PullReviewComment/properties/position - The format uint64 is not supported by Kiota for the type integer and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/User/properties/email - The format email is not supported by Kiota and the string type will be used.
fail: Kiota.Builder.KiotaBuilder[0]
      OpenAPI error: #/paths//repos/{owner}/{repo}/git/commits/{sha}.{diffType} - The path signature '/repos/{}/{}/git/commits/{}' MUST be unique.
fail: Kiota.Builder.KiotaBuilder[0]
      OpenAPI error: #/paths//repos/{owner}/{repo}/pulls/{index}.{diffType} - The path signature '/repos/{}/{}/pulls/{}' MUST be unique.
warn: Kiota.Builder.KiotaBuilder[0]
      Omitted property content for model FileDeleteResponse in API path \repos\{repos-id}\{Owner-id}\contents\{filepath}, the schema is invalid.
warn: Kiota.Builder.KiotaBuilder[0]
      Omitted property reason for model WatchInfo in API path \repos\{repos-id}\{Owner-id}\subscription, the schema is invalid.
Generation completed successfully

The notable thing here is that 1.9.0 seems to invent path parameters {repos-id} and {Owner-id}, which are not defined in the swagger.v1.json

This gives problems with path parameters not mapping correctly to the URL template when using the generated library, since the template will reference these invented parameters, but the path parameters are set correctly (to owner and repo), so it will generate request strings like ...///... as opposed to .../some-owner/some-repo/...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

WIPgeneratorIssues or improvements relater to generation capabilities.type:bugA broken experience

Type

No type

Projects

  • Status

    Done ✔️

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions