Contact Free trial Login

API Mocking Service Release Notes

2.15.0

June 27, 2020

This release includes minor bug fixes.

2.14.0

May 30, 2020

This release includes minor bug fixes.

2.13.0

May 2, 2020

  • The mocking service returned an Invalid schema for content type application/xml error message for POST methods when these two conditions were met:

    • The value for a string in the request matched a regex pattern.

    • The media type for the specification was application/xml.

    For example, mocking a POST request for the following specification would cause the error:

    +

    #%RAML 1.0
    title: Regex-Test
    
    mediaType: application/xml
    types:
      xml:
        properties:
          zip:
            type: string
            pattern: (\d{5})
    /test:
      post:
        body:
          application/xml:
            type: xml
        responses:
          200:
  • The mocking service would fail to start if a project contained any files with filenames that contained characters not allowed in URLs.

  • The mocking service was not validating file types when files in mock POST requests were uploaded.

  • The mocking service returned an Invalid schema for content type application/xml message when an enum was used in POST requests for which the response body was declared as application/xml.

  • The mocking service returned an Invalid schema for content type text/xml message when the content type for an XSD file in the body of a POST request was declared as text/xml.

2.12.0

April 4, 2020

  • The mocking service returned the wrong example in cases such as the following: in an API specification written in RAML, a type is defined with an example, but a response that uses the type overrides the example with an !include directive. Rather than use the included example in the response, the mocking service used the example from the type definition.

    For example, the following simple specification defines the type ExampleRoot. The definition includes the example Internal Example. For the endpoint /tmp, the specification defines a response that uses ExampleRoot, but provides a different example, which is referred to with an !include directive.

    #%RAML 1.0
    title: Example API with types and resources to showcase how examples look.
    mediaType:
     - application/json
    types:
      ExampleRoot:
        properties:
          string:
            type: string
            example: Internal Example
    /foo/example:
      get:
        responses:
          200:
            body:
              type: ExampleRoot
    /tmp:
      get:
        responses:
          200:
            body:
              type: ExampleRoot
              examples: !include external-example.raml

    If a request was made on /tmp before the fix, the response that the mocking service sent incorrectly contained Internal Example as the example for ExampleRoot.

  • The mocking service was not validating an example-array header that was of type: string and not an array. Now, you can use valid strings in these headers.

2.11.0

  • March 7, 2020*

This release of the mocking service fixes the following issues:

  • The mocking service was not validating DataType fragments that were referenced by a Library fragment that was in trun referenced by the root file in an API-specification project.

  • The mocking service did not return an error message if a required query parameter was missing or the value was empty.

  • In a particular case, the mocking service was not returning an example in responses, even though the example was defined.

  • It was not possible to import an XSD schema into API Designer in Anypoint Design Center through the mocking service.

    The mocking service failed with the message Invalid schema for content type application/xml. Errors: key not found: http://www.w3.org/2001/xml.xsd.

2.9.0

January 11, 2020

This release of the mocking service fixes the following issues.

  • If you set the authentication type to "Client Credentials" and then set a scope, the scope was not saved.

  • The mocking service returned empty responses instead of expected JSON responses in some cases, both in API Designer and in Exchange.

  • When the mocking service validated XML against an XSD schema that imported a namespace, it returned the following error message: Invalid schema for content type application/xml. Errors: URI has an authority component..

  • XML payloads in requests were not considered valid when a Union data type was used for XML schemas.

  • When the behavioral header MS2-Status-Code was used and set to 400, the mocking service returned the example that was defined for status code 200.

  • In API Console, the names of query parameters were being populated from parameter identifiers in parameter definitions, not from the parameter names. This problem occurred for API specifications written in OAS 2.0.

Deprecation of Version 1 of the Mocking Service

As of December 1, 2019, Version 1 of the mocking service is deprecated. MuleSoft recommends that you upgrade your API-specification projects in API Designer to use Version 2 of the mocking service.

You can continue to use Version 1 until February 1, 2020. By default, however, Version 1 now returns the following response to every request:

Status Code: 410 Gone
Response headers:
   deprecation: date="Fri, 29 Nov 2019 23:59:59 GMT"
   link: https://docs.mulesoft.com/design-center/design-migrating-ms

For Version 1 to respond with a status code that is defined in an API specification, you must add the following header to requests:

name: x-deprecation-acknowledgement
value: I understand that version 1 of the mocking service is deprecated and that I need to upgrade before February 1, 2020.

Here is an example of this header used in a specification that is written in RAML:

#%RAML 1.0
baseUri: https://mocksvc.devx.anypoint.mulesoft.com/mocks/d25ddb9c-ad20-4e80-af96-60217cc9f0b6/
version: v1
title: MS-TEST

/test:
  get:
    headers:
      x-deprecation-acknowledgement:
        type: string
        required: false
        example: I understand that version 1 of the mocking service is deprecated and that I need to upgrade before February 1, 2020.
      Cache-Control:
        type: string
        required: true
        example: no-cache

    responses:
      200:
        body:
          application/json:
            example:
              "OK"

2.6.0

October 5, 2019

DateTime elements appeared with null values in responses from the mocking service, even when API specifications provided example responses that contained values for these elements.

2.5.0

September 7, 2019

Announcement

Version 2 of the mocking service is replacing Version 1. You must migrate any API-specification project that meets both of these conditions:

  • The mocking service was switched on for the project before January 10, 2019.

  • The mocking service has been running continuously since it was switched on.

Dates for the Deprecation and End of Life of Version 1

  • On November 29, 2019, Version 1 of the mocking service will be deprecated. Starting on that date, third-party tools must include this header in requests that they send to the mocking service to test endpoints in API specifications being developed in API Designer:

    x-deprecation-acknowledgement

    The header must have this value:

    I understand that version 1 of the mocking service is deprecated and that I need to upgrade before February 1, 2020.

  • Starting February 1, 2020, Version 1 of the mocking service will no longer send responses to requests. If you have not migrated your projects to use Version 2 of the mocking service by this date, the mocking service will return the HTTP status code 301 and provide a link to this document.

New Feature

The new behavioral header MS2-Status-Code-Selection gives you two options for controlling how the mocking service selects a status code for responses to requests. See Add Behavioral Headers to Simulated API Calls for details.

2.4.0

August 10, 2019

This release includes minor bug fixes.

2.3.0

July 13, 2019

Fixed Issues

  • Executing the Get command in RAML produces an empty response in the example data.

  • Request and response are not showing up in the mocking service.

2.2.0

June 15, 2019

This release contains one new feature and two fixes.

New Feature

  • Use behavioral headers with the mocking service to modify in various ways how the mocking service behaves. See Add Behavioral Headers to Simulated API Calls.

  • Now, the mocking service supports XML serialization facets, such as wrapped, attribute, and name, when generating an XML response that is based on a RAML example.

Fixed Issues

  • The mocking service included invalid tags in returned XML when the data type contained an array.

  • The mocking service converted null values to string "null" values.

2.1.8

May 18, 2019

  • The API Console and the mocking service were adding invalid tags to XML examples.

  • Though multiple examples were defined for an endpoint, the mocking service always used the same example, rather than randomly selecting one to use.

  • When an OAS API specification did not define any consuming media type for a specific endpoint, the mocking service failed.

2.1.0

February 23, 2019

The following issues were resolved in this release: * For an API specification written in RAML, the mocking service returned content that was in YAML, although the returned content should have been in XML. * The mocking service returned a misleading error message when baseURI was invalid.

2.1.0

January 10, 2019

The following issues were resolved in this release:

  • [SE-8276] - Issues with Design Center

  • [SE-8614] - Request header 'Accept' failing when application/xml is present before application/json

  • [SE-8666] - Mocking service for OAuth 2.0 requires users to provide both authorization header and access token

  • [SE-8745] - Mocking service required parameters are allowed to be left out

  • [SE-8790] - Mocking Server Validation on Message Body

  • [SE-8999] - RAML in Design Center: Unexpected token A in JSON at position 1

  • [SE-9588] - Mock Service returns 404 for paths with hyphens in 3rd level resource name

  • [SE-9830] - Mock service api always return 400

  • [SE-9990] - JSON Schema defined inline in Design Center RAML gives error, OK on Studio

  • [SE-10045] - Incorrect Datetime-only format error when trying on mocking service from design center

  • [SE-10194] - RAML issue with optional enum type headers

  • [SE-10222] - additionalProperties=false in RAML are ignored by Design Center and exchange Mocking services.

1.1.11

August 21, 2018

This release fixes the following issue:

  • The mocking service did not return messages for the 400 response in the correct styling.

1.1.10

June 30, 2018

This release fixes the following issue:

  • TLS 1.0 and 1.1 were still supported. Now, only 1.2 is supported.

1.1.9

May 19, 2018

The parser is now at version 1.1.42.

1.1.8

April 21, 2018

  • Invoking a resource that required the uriParameter (e.g., “/master/{attname}”) returned the example response for root instead of the defined example.

  • Invoking a resource that required a uriParameter and then using the example parameter in a GET or PUT method resulted in a response containing the complete API specification.

1.1.7

March 24, 2018

This release bumps the parser and includes bug fixes.

Improvements

Bumped parser to 1.1.41.

Fixed Issues

  • Parsing no longer returns an Error for XML and Schema valid.

  • Fixed an issue with getting validation errors while building RAML for XML with Attributes and Inner text.

  • Fixed an issue that prevented some methods that return an Array from correctly showing the response example.

1.1.6

February 24, 2018

This release fixes several bugs.

Fixed Issues

  • A problem that prevented validation datetime query parameters with format RFC3339.

  • The issue causing RAML with a null response to return "message": in the HTTP response with 0 length.

  • The multipleOf facet validation issue.

1.1.5

January 13, 2018

This release resolves a few issues:

Resolved Issues

  • Fixed a problem related to a URI parameter name containing a hyphen (-) character.

  • Fixed an issue with making a request that has a empty body of type application/json.

  • Fixed a bug that returned a 400 "body: unknown type any" when using a body with an example that has no type definition.

1.1.4

December 16, 2017

This release introduces the following improvements and resolved issues:

Improvements

  • Using the mocking service from a proxy application overrides the mocking service of the API itself.

  • The Authorization header check for path simulation has been removed.

  • When you don’t specify the main example for a DataType, the mocking service provides the examples defined for each property.

Resolved Issues

  • Using a proxy application, the mocking service now validates the Body of the method when you try to POST it.

  • Using a base URI ending with / no longer causes a 404 error.

  • The mocking service now recognizes object type as an enum in a URI parameter.

  • Enforcement of a required data type has been fixed. An absent data type or one that does not include all required fields is rejected.

  • The problem related to using the RAML anonymous security scheme has been fixed.

1.1.3

October 21, 2017

This release focuses on bug fixes.

Improvements

  • Enhanced the Mocking Server to respond with random examples if more than one is available.

  • A successful mock creation POST request now returns a 201 response status code instead of 200.

Resolved Issues

Fixed to work properly when the RAML has URI parameters.

1.1.2

August 26, 2017

This release focuses on bug fixes.

Resolved Issues

  • Examples defined in datatypes were not displayed properly.

  • Mocking server was returning 404 for calls with query parameters.

1.1.1

July 15, 2017

This release focuses on bug fixes and closing gaps for RAML 1.0 support.

Resolved Issues

Fixed an issue preventing API Notebook text from expanding properly.

Was this article helpful?

💙 Thanks for your feedback!