microsoft / microsoft/kiota

Kiota CLI warning "does not support ISO3166-1 type String"

Open
#6,756 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Csharp Needs: Attention :wave: type:question
Dominant language
C#
Stars
3.8k
Forks
333
Avg merge
16h 29m
Merged PRs (30d)
116

Description

### What are you generating using Kiota, clients or plugins?

API Client/SDK

### In what context or format are you using Kiota?

Nuget tool

### Client library/SDK language

Csharp

### Describe the bug

Missing information in the docs about this problem and possible results at runtime. Might be critical since this api requires this encoding, might be just fitting casing for String type to string type. I would need information to know if I can use kiota generated client for this api with getting this warnings please!

```bash
PS C:\Users\TKSSonja\source\repos\DevTKSS\DevTKSS.Clients\DevTKSS.Clients.EtsyClient> kiota generate --language csharp --openapi https://www.etsy.com/openapi/generated/oas/3.0.0.json --class-name EtsyClient --namespace-name DevTKSS.Clients.EtsyClient
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shipping-carriers/get/parameters/0/schema - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shops~1{shop_id}~1shipping-profiles/post/requestBody/content/application~1x-www-form-urlencoded/schema/properties/origin_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shops~1{shop_id}~1shipping-profiles/post/requestBody/content/application~1x-www-form-urlencoded/schema/properties/destination_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shops~1{shop_id}~1shipping-profiles~1{shipping_profile_id}/put/requestBody/content/application~1x-www-form-urlencoded/schema/properties/origin_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shops~1{shop_id}~1shipping-profiles~1{shipping_profile_id}~1destinations/post/requestBody/content/application~1x-www-form-urlencoded/schema/properties/destination_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shops~1{shop_id}~1shipping-profiles~1{shipping_profile_id}~1destinations~1{shipping_profile_destination_id}/put/requestBody/content/application~1x-www-form-urlencoded/schema/properties/destination_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/components/schemas/ShopShippingProfile/properties/origin_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/components/schemas/ShopShippingProfileDestination/properties/origin_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/components/schemas/User/properties/primary_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/Shop/properties/shipping_from_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/components/schemas/Shop/properties/shop_location_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/components/schemas/ShopReceipt/properties/seller_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/ShopHolidayPreference/properties/country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
Generation completed successfully
Client base url set to https://openapi.etsy.com

Hint: use the info command to get the list of dependencies you need to add to your project.
Example: kiota info -d "https://www.etsy.com/openapi/generated/oas/3.0.0.json" -l CSharp

Hint: use the --include-path and --exclude-path options with glob patterns to filter the paths generated.
Example: kiota generate --include-path "**/foo" -d "https://www.etsy.com/openapi/generated/oas/3.0.0.json"
```

### Expected behavior

Docs should tell about how to act when this happens or this problem should not even happning, because it can mean the code is not usable for this open api spec

### How to reproduce

create a Class Library and execute this:

kiota generate --language csharp --openapi https://www.etsy.com/openapi/generated/oas/3.0.0.json --class-name EtsyClient --namespace-name DevTKSS.Clients.EtsyClient

### Open API description file

https://www.etsy.com/openapi/generated/oas/3.0.0.json

### Kiota Version

1.28.0+57130b1b1db3bc5c060498682f41e20c8ae089f2

### Latest Kiota version known to work for scenario above?(Not required)

_No response_

### Known Workarounds

build your application assuming its just a casing information and possibly fail hard at runtime if it generated not usable code?

### Configuration

Windows 11 Pro
x64
used dotnet to install the cli tool

### Debug output

Click to expand log
```
PS C:\Users\TKSSonja\source\repos\DevTKSS\DevTKSS.Clients\DevTKSS.Clients.EtsyClient> kiota generate --language csharp --openapi https://www.etsy.com/openapi/generated/oas/3.0.0.json --class-name EtsyClient --namespace-name DevTKSS.Clients.EtsyClient --ll debug
dbug: Kiota.Builder.KiotaBuilder[0]
kiota version 1.28.0
dbug: Kiota.Builder.KiotaBuilder[0]
cache file C:\Users\TKSSonja\AppData\Local\Temp\kiota\cache\generation\EF533842AAE73EA242BC8366033615847E1C6C2766266A29274FBBD3C27B955F\3.0.0.json is up to date and clearCache is False, using it
info: Kiota.Builder.KiotaBuilder[0]
loaded description from remote source
dbug: Kiota.Builder.KiotaBuilder[0]
step 1 - reading the stream - took 00:00:00.0149266
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shipping-carriers/get/parameters/0/schema - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shops~1{shop_id}~1shipping-profiles/post/requestBody/content/application~1x-www-form-urlencoded/schema/properties/origin_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shops~1{shop_id}~1shipping-profiles/post/requestBody/content/application~1x-www-form-urlencoded/schema/properties/destination_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shops~1{shop_id}~1shipping-profiles~1{shipping_profile_id}/put/requestBody/content/application~1x-www-form-urlencoded/schema/properties/origin_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shops~1{shop_id}~1shipping-profiles~1{shipping_profile_id}~1destinations/post/requestBody/content/application~1x-www-form-urlencoded/schema/properties/destination_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/paths/~1v3~1application~1shops~1{shop_id}~1shipping-profiles~1{shipping_profile_id}~1destinations~1{shipping_profile_destination_id}/put/requestBody/content/application~1x-www-form-urlencoded/schema/properties/destination_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/components/schemas/ShopShippingProfile/properties/origin_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/components/schemas/ShopShippingProfileDestination/properties/origin_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/components/schemas/User/properties/primary_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/Shop/properties/shipping_from_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/components/schemas/Shop/properties/shop_location_country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
OpenAPI warning: #/components/schemas/ShopReceipt/properties/seller_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/ShopHolidayPreference/properties/country_iso - The format ISO 3166-1 alpha-2 is not supported by Kiota for the type String and the string type will be used.
dbug: Kiota.Builder.KiotaBuilder[0]
step 2 - parsing the document - took 00:00:00.2494847
dbug: Kiota.Builder.KiotaBuilder[0]
step 3 - updating generation configuration from kiota extension - took 00:00:00.0002000
dbug: Kiota.Builder.KiotaBuilder[0]
step 4 - filtering API paths with patterns - took 00:00:00.0054486
info: Kiota.Builder.KiotaBuilder[0]
Client root URL set to https://openapi.etsy.com
dbug: Kiota.Builder.KiotaBuilder[0]
step 5 - checking whether the output should be updated - took 00:00:00.0477498
dbug: Kiota.Builder.KiotaBuilder[0]
step 6 - create uri space - took 00:00:00.0050957
dbug: Kiota.Builder.KiotaBuilder[0]
InitializeInheritanceIndex 00:00:00.0040656
dbug: Kiota.Builder.KiotaBuilder[0]
CreateRequestBuilderClass 00:00:00
dbug: Kiota.Builder.KiotaBuilder[0]
MapTypeDefinitions 00:00:00.0164897
dbug: Kiota.Builder.KiotaBuilder[0]
TrimInheritedModels 00:00:00
dbug: Kiota.Builder.KiotaBuilder[0]
CleanUpInternalState 00:00:00
dbug: Kiota.Builder.KiotaBuilder[0]
step 7 - create source model - took 00:00:00.1799393
dbug: Kiota.Builder.KiotaBuilder[0]
128ms: Language refinement applied
dbug: Kiota.Builder.KiotaBuilder[0]
step 8 - refine by language - took 00:00:00.1296667
dbug: Kiota.Builder.KiotaBuilder[0]
step 9 - writing files - took 00:00:00.5899484
dbug: Kiota.Builder.KiotaBuilder[0]
cache file C:\Users\TKSSonja\AppData\Local\Temp\kiota\cache\generation\EF533842AAE73EA242BC8366033615847E1C6C2766266A29274FBBD3C27B955F\3.0.0.json is up to date and clearCache is False, using it
info: Kiota.Builder.KiotaBuilder[0]
loaded description from remote source
dbug: Kiota.Builder.KiotaBuilder[0]
step 10 - writing lock file - took 00:00:00.0376230
Generation completed successfully
Client base url set to https://openapi.etsy.com
dbug: Kiota.Builder.KiotaBuilder[0]
Api manifest path: C:\Users\TKSSonja\source\repos\DevTKSS\DevTKSS.Clients\DevTKSS.Clients.EtsyClient\apimanifest.json

Hint: use the info command to get the list of dependencies you need to add to your project.
Example: kiota info -d "https://www.etsy.com/openapi/generated/oas/3.0.0.json" -l CSharp

Hint: use the --include-path and --exclude-path options with glob patterns to filter the paths generated.
Example: kiota generate --include-path "**/foo" -d "https://www.etsy.com/openapi/generated/oas/3.0.0.json"

```

### Other information

in other programming languages, like javascript, the string type might have different casing, but whats this about the iso I dont know

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reported kiota generate command against the Etsy OpenAPI URL and review the warnings for ISO 3166-1 alpha-2 and email formats. Consult the Kiota warning behavior and documentation structure; done means the docs explain the string fallback, its runtime implications, and how users should assess generated clients.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, openapi
Domain
devtools, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.