Kiota CLI warning "does not support ISO3166-1 type String"
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!
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.jsonHint: 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"
</details>
### Other information
in other programming languages, like javascript, the string type might have different casing, but whats this about the iso I dont know
Hi @DevTKSS Thank you for using kiota and for reaching out.
This is expected as there's no native serialization and deserialization type for that specific format.
You can use the client, the only drawback is that you'll have to parse and serialize to string yourself instead of getting a date type directly.
Let us know if you have any questions or comments.
@baywet not sure if I understood the workaround, would you be able to show me a sample for this to make possible? Reading their docs, this Format stands for country code dateTime and similar
Thank you for the additional information.
Sorry, reading ISO I assumed that we were talking about dates when instead we're talking about country codes.
This is fine, you'll need to set the country codes on the properties using strings, you can potentially use a 3rd party library to parse/get the country code and serialize it to a string before assigning the kiota generated code.
Let us know if you have any additional comments or questions.
I have transitioned to a new team and won't be replying to this issue/pull request moving forward. Thank you for your understanding.
would be good if those ISO would be supported in the future as its kind of regular e-commerce open api spec I inserted into the Kiota CLI...