prism icon indicating copy to clipboard operation
prism copied to clipboard

Mock server returns int64 value less than the lower limit

Open atkei opened this issue 3 years ago • 0 comments

Describe the bug

The range of int64 is -9223372036854775808 (-2^63) ~ 9223372036854775807 (2^63-1), but the mock server seems to return -9223372036854776000 by default.

To Reproduce

  1. Install prism.
npm install -g @stoplight/prism-cli
  1. Start a mock server with the following command.
prism mock https://raw.githack.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml
  1. Call a REST API that returns a response containing an int64 value.
curl -X GET "http://localhost:4010/pets/1"
{"name":"string","tag":"string","id":-9223372036854776000}

Expected behavior

The mock server returns -9223372036854775808 or a value in the range of int64.

Additional context

Environment (remove any that are not applicable):

  • Library version: 4.7.0
  • OS: Pop!_OS 21.04
  • Browser: Not using
  • Platform: Desktop

atkei avatar Feb 18 '22 11:02 atkei