Forum Discussion

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Yes, "www.example.com" is a valid hostname, just like "api.example.com" and "subdomain.example.com". The "www" prefix is just a subdomain.

    An OpenAPI 2.0 definition with this hostname could look like this:

    swagger: '2.0'
    host: www.example.com
    schemes: [https]
    basePath: /api
    ...

    OpenAPI 3.0 version:

    openapi: 3.0.0
    servers:
      - url: https://www.example.com/api
    ...