title: Generate Swagger YAML Open API Spec programmatically from WSDL/XML
body: <p>I have a SOAP API already defined via WSDLs. Is there any tool that I can use to convert WSDL to Open API Swagger documents?</p>
  
  <p>I am assuming that I would need to write custom code to to create a Swagger 3.0 Open API YAML specification from an XML.</p>
  
  <p>XML:</p>
  
  <pre><code>&lt;country&gt;
   &lt;name&gt;ABC&lt;/name&gt;
   &lt;population&gt;100&lt;/population&gt;
   &lt;political_system&gt;
    &lt;system_type&gt;Democracy&lt;/system_type&gt;
    &lt;legislature&gt;bicameral&lt;/legislature&gt;
  &lt;/country&gt;
  </code></pre>
  
  <p>Open API Definition:</p>
  
  <pre><code>openapi: "3.0.0"
  info:
    version: 1.0.0
    title: SysCountry  
  servers:
    - url: http://localhost:5595/api/
  paths:
   /Country:
    get:
     tags:
      -countries
     responses:
      '200':
        description:List of countries
        content:
         application/json:
          schema:
           $ref:"#/components/schemas/Countries
    post:
     summary:Create a country
     tags:
      -Conuntries
     requestBody:
      required: true
      content:
            application/json:
             schema: 
              $ref: '#/components/schemas/Country'
      responses:
          '201':
            description: Null response
  components:
    schemas:
      Country:
        type: object
        required:
          - name
        properties:
          name:
            type: string
          population:
            type: integer
          political_system:
            type: object
            properties:
              system_type:
                type: string
              legislature:
                type:string
      Countries:
        type: array
        items:
          $ref: "#/components/schemas/Country"
  </code></pre>
  
  <p>Is there any .NET C# library that can be used to create YAML documents programmatically (maybe something similar to an XMLDocument)?</p>