feature: allowEmptyValue controls (#4788)
* add baseline tests * coerce empty strings to null when updating parameter values * add ParameterIncludeEmpty * add redux management for empty parameter value inclusion state * use name+in keying for state management instead of hash keying * update new redux method usages to name+in keying * coerce empty Immutable iterables in onChangeWrapper * OAS3 tests & support * add included empty parameters to requests before dispatching to Swagger Client * make empty inclusion interface prettier * add tests for #4587 * linter fixes * check for truthy value before reaching into property
This commit is contained in:
126
test/e2e/specs/bugs/4587.yaml
Normal file
126
test/e2e/specs/bugs/4587.yaml
Normal file
@@ -0,0 +1,126 @@
|
||||
---
|
||||
swagger: '2.0'
|
||||
info:
|
||||
version: 0.0.1
|
||||
title: DDErl REST interface
|
||||
description: RESTful access to IMEM DB and DDErl
|
||||
schemes:
|
||||
- http
|
||||
- https
|
||||
securityDefinitions:
|
||||
basicAuth:
|
||||
type: basic
|
||||
description: HTTP Basic Authentication Username:Password
|
||||
basePath: "/dderlrest/0.0.1"
|
||||
paths:
|
||||
"/sql/":
|
||||
get:
|
||||
tags:
|
||||
- sql
|
||||
security:
|
||||
- basicAuth: []
|
||||
summary: execute sql
|
||||
operationId: execSql
|
||||
description: Prepare and execute SQL statements
|
||||
parameters:
|
||||
- name: x-irest-conn
|
||||
in: header
|
||||
required: false
|
||||
description: ErlImem connection identifier
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
schema:
|
||||
type: object
|
||||
headers:
|
||||
x-irest-conn:
|
||||
description: ErlImem connection identifier
|
||||
type: string
|
||||
'403':
|
||||
description: Malformed/Invalid
|
||||
schema:
|
||||
"$ref": "#/definitions/ErrorResponse"
|
||||
definitions:
|
||||
ErrorResponse:
|
||||
readOnly: true
|
||||
type: object
|
||||
required:
|
||||
- errorCode
|
||||
- errorMessage
|
||||
- errorDetails
|
||||
properties:
|
||||
errorCode:
|
||||
description: Error Code
|
||||
type: number
|
||||
example: 1400
|
||||
errorMessage:
|
||||
description: Error Message
|
||||
type: string
|
||||
example: malformed
|
||||
errorDetails:
|
||||
description: Error Details
|
||||
type: string
|
||||
example: mandatory properties missing or bad type
|
||||
ViewParams:
|
||||
readOnly: true
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- typ
|
||||
- value
|
||||
- name
|
||||
properties:
|
||||
name:
|
||||
description: Name
|
||||
type: string
|
||||
example: ":atom_user"
|
||||
value:
|
||||
description: Value
|
||||
type: string
|
||||
example: system
|
||||
typ:
|
||||
description: Datatype
|
||||
type: string
|
||||
enum:
|
||||
- atom
|
||||
- binary
|
||||
- raw
|
||||
- blob
|
||||
- rowid
|
||||
- binstr
|
||||
- clob
|
||||
- nclob
|
||||
- varchar2
|
||||
- nvarchar2
|
||||
- char
|
||||
- nchar
|
||||
- boolean
|
||||
- datetime
|
||||
- decimal
|
||||
- float
|
||||
- fun
|
||||
- integer
|
||||
- ipaddr
|
||||
- list
|
||||
- map
|
||||
- number
|
||||
- pid
|
||||
- ref
|
||||
- string
|
||||
- term
|
||||
- binterm
|
||||
- timestamp
|
||||
- tuple
|
||||
- userid
|
||||
example: atom
|
||||
dir:
|
||||
description: Direction
|
||||
type: string
|
||||
enum:
|
||||
- in
|
||||
- out
|
||||
default: in
|
||||
64
test/e2e/specs/features/allow-empty-value.openapi.yaml
Normal file
64
test/e2e/specs/features/allow-empty-value.openapi.yaml
Normal file
@@ -0,0 +1,64 @@
|
||||
openapi: "3.0.0"
|
||||
|
||||
paths:
|
||||
/regularParams:
|
||||
get:
|
||||
parameters:
|
||||
- name: int
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
- name: str
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: num
|
||||
in: query
|
||||
schema:
|
||||
type: number
|
||||
- name: bool
|
||||
in: query
|
||||
schema:
|
||||
type: boolean
|
||||
- name: arr
|
||||
in: query
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
/emptyValueParams:
|
||||
get:
|
||||
parameters:
|
||||
- name: int
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
allowEmptyValue: true
|
||||
- name: str
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
allowEmptyValue: true
|
||||
- name: num
|
||||
in: query
|
||||
schema:
|
||||
type: number
|
||||
allowEmptyValue: true
|
||||
- name: bool
|
||||
in: query
|
||||
schema:
|
||||
type: boolean
|
||||
allowEmptyValue: true
|
||||
- name: arr
|
||||
in: query
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
allowEmptyValue: true
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
57
test/e2e/specs/features/allow-empty-value.swagger.yaml
Normal file
57
test/e2e/specs/features/allow-empty-value.swagger.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
swagger: "2.0"
|
||||
|
||||
consumes:
|
||||
- application/json
|
||||
- multipart/form-data
|
||||
paths:
|
||||
/regularParams:
|
||||
get:
|
||||
parameters:
|
||||
- name: int
|
||||
in: query
|
||||
type: integer
|
||||
- name: str
|
||||
in: query
|
||||
type: string
|
||||
- name: num
|
||||
in: query
|
||||
type: number
|
||||
- name: bool
|
||||
in: query
|
||||
type: boolean
|
||||
- name: arr
|
||||
in: query
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
/emptyValueParams:
|
||||
get:
|
||||
parameters:
|
||||
- name: int
|
||||
in: query
|
||||
type: integer
|
||||
allowEmptyValue: true
|
||||
- name: str
|
||||
in: query
|
||||
type: string
|
||||
allowEmptyValue: true
|
||||
- name: num
|
||||
in: query
|
||||
type: number
|
||||
allowEmptyValue: true
|
||||
- name: bool
|
||||
in: query
|
||||
type: boolean
|
||||
allowEmptyValue: true
|
||||
- name: arr
|
||||
in: query
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
allowEmptyValue: true
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
Reference in New Issue
Block a user