Should Pulumi be able to import swagger version 3 ...
# azure
b
Should Pulumi be able to import swagger version 3 api’s in a api managment api. We get the following error?
t
Yes, if the service supports it
b
how do we know whether the service supports it?
if we can import it manually?
t
yes, for example. and look at the generated arm template after that
I think @wet-noon-14291 was doing something like that?
b
cool thank you
@tall-librarian-49374 seems like we can do it manually, but it fails with pulumi. we opened the source and it seems like it is hardcoded to version 2.0
Copy code
/// <summary>
    /// The OpenAPI 2.0 JSON document is hosted on a publicly accessible internet address.
    /// </summary>
    public static ContentFormat Swagger_link_json { get; } = new ContentFormat("swagger-link-json");
in ContentFormat.cs
t
This is the enum, right?
Try this one?
Copy code
/// <summary>
        /// The OpenAPI 3.0 JSON document is hosted on a publicly accessible internet address.
        /// </summary>
        public static ContentFormat Openapi_json_link { get; } = new ContentFormat("openapi+json-link");
b
we only tried decompiling but it looks like a enumtype
Copy code
/// <summary>
/// Format of the Content in which the API is getting imported.
/// </summary>
[EnumType]
public readonly struct ContentFormat : IEquatable<ContentFormat>
b
thank you, we now got further. the error was due to ContentFormat.swagger json link and we changed it to openapi instead and now it got created. THANK YOU!
w
I did the exact same mistake @brave-winter-60074. It is actually in the doc if you expand the Open API 3 example: https://www.pulumi.com/docs/reference/pkg/azure-nextgen/apimanagement/api/#apimanagementcreateapiusingoai3import .
b
Thank you!