Endpoint mappings

The global mapping variations are also available as explicit endpoint mappings. Instead of adding the mapping in the global sections map/types, map/parameters and map/responses they can be placed in the map/paths section as properties to an endpoint given by its path.

map:

  # path mappings, only valid for the given path
  paths:

    # a path
    /foo:

      # path specific result wrapper
      result: {target type}

      # path specific single wrapper
      single: {target type}

      # path specific multi wrapper
      multi: {target type}

      # list of path specific mappings
      types:
        - from: {source type}  =>  {target type}

      # list of path specific parameter mappings, mapped by parameter name
      parameters:
        - name: {parameter name}  =>  {target type}

        # the list of parameter mappings can include additional parameters
        - add: {parameter name}  =>  {target type}

      # list of path specific content mappings, mapped by content type
      responses:
        - content: {content type}  =>  {target type}

    # a path
    /foobar:
      # excluding an endpoint
      exclude: true

      # path specific result wrapper
      result: {target type}

      # path specific single wrapper
      single: {target type}

      # path specific multi wrapper
      multi: {target type}

      # list of path specific mappings
      types:
        - from: {source type}  =>  {target type}

      # list of path specific parameter mappings, mapped by parameter name
      parameters:
        - name: {parameter name}  =>  {target type}

        # the list of parameter mappings can include additional parameters
        - add: {parameter name}  =>  {target type}

      # list of path specific content mappings, mapped by content type
      responses:
        - content: {content type}  =>  {target type}

The mappings defined as properties of an endpoint will be used only for this endpoint. They don’t have any effect on other endpoints.

excluding endpoints

since 1.0.0.M6

It is possible to exclude endpoints from generation to make it easier to provide a hand written interface for the excluded endpoint.

Excluding does not completely ignore the endpoint. Instead of generating it into the normal interface it is generated to a new interface with Excluded attached to its name. Type mappings still apply.

That way the generated code is still available for reference, but it can be skipped by not implementing the Excluded interface.

map:
 /foo:
   # excluding an endpoint
   exclude: true