Use deterministic randomness in ExampleGenerator. (#5068)

* Update samples for nodejs + nodejs-google-cloud-functions.

* Fix example generator to use deterministic randomness.

This avoids changing results after each generation, and makes diff reviews easier.

* Update NodeJS samples.

This is the last "randomness" update. From now on the samples should only change if either the generator, the input or parameters change.
This commit is contained in:
Paŭlo Ebermann
2017-03-15 10:15:13 +01:00
committed by wing328
parent b2aa877ce0
commit 31f29be2a0
14 changed files with 254 additions and 180 deletions

View File

@@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@@ -108,11 +108,11 @@ paths:
type: "array"
items:
type: "string"
default: "available"
enum:
- "available"
- "pending"
- "sold"
default: "available"
collectionFormat: "csv"
responses:
200:
@@ -356,8 +356,8 @@ paths:
description: "ID of pet that needs to be fetched"
required: true
type: "integer"
maximum: 5.0
minimum: 1.0
maximum: 5
minimum: 1
format: "int64"
responses:
200:

View File

@@ -35,14 +35,14 @@ exports.findPetsByStatus = function(args, res, next) {
examples['application/json'] = [ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"id" : 1,
"id" : 0,
"category" : {
"name" : "aeiou",
"id" : 7
"id" : 6
},
"tags" : [ {
"name" : "aeiou",
"id" : 2
"id" : 1
} ],
"status" : "available"
} ];
@@ -66,14 +66,14 @@ exports.findPetsByTags = function(args, res, next) {
examples['application/json'] = [ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"id" : 9,
"id" : 0,
"category" : {
"name" : "aeiou",
"id" : 7
"id" : 6
},
"tags" : [ {
"name" : "aeiou",
"id" : 4
"id" : 1
} ],
"status" : "available"
} ];
@@ -97,14 +97,14 @@ exports.getPetById = function(args, res, next) {
examples['application/json'] = {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"id" : 4,
"id" : 0,
"category" : {
"name" : "aeiou",
"id" : 4
"id" : 6
},
"tags" : [ {
"name" : "aeiou",
"id" : 4
"id" : 1
} ],
"status" : "available"
};
@@ -152,7 +152,7 @@ exports.uploadFile = function(args, res, next) {
**/
var examples = {};
examples['application/json'] = {
"code" : 7,
"code" : 0,
"type" : "aeiou",
"message" : "aeiou"
};

View File

@@ -40,9 +40,9 @@ exports.getOrderById = function(args, res, next) {
**/
var examples = {};
examples['application/json'] = {
"petId" : 2,
"quantity" : 9,
"id" : 5,
"petId" : 6,
"quantity" : 1,
"id" : 0,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"complete" : false,
"status" : "placed"
@@ -65,9 +65,9 @@ exports.placeOrder = function(args, res, next) {
**/
var examples = {};
examples['application/json'] = {
"petId" : 5,
"quantity" : 5,
"id" : 1,
"petId" : 6,
"quantity" : 1,
"id" : 0,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"complete" : false,
"status" : "placed"

View File

@@ -57,9 +57,9 @@ exports.getUserByName = function(args, res, next) {
"firstName" : "aeiou",
"lastName" : "aeiou",
"password" : "aeiou",
"userStatus" : 4,
"userStatus" : 6,
"phone" : "aeiou",
"id" : 5,
"id" : 0,
"email" : "aeiou",
"username" : "aeiou"
};