Read me for modelPropertyMacro, changed for parameterMacro

This commit is contained in:
Anna Bodnia
2017-05-25 18:04:21 +03:00
parent 918e0e46c0
commit 62cb9ec581
3 changed files with 3 additions and 5 deletions

View File

@@ -115,7 +115,8 @@ dom_id | The id of a dom element inside which SwaggerUi will put the user interf
oauth2RedirectUrl | OAuth redirect URL oauth2RedirectUrl | OAuth redirect URL
operationsSorter | Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically), 'method' (sort by HTTP method) or a function (see Array.prototype.sort() to know how sort function works). Default is the order returned by the server unchanged. operationsSorter | Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically), 'method' (sort by HTTP method) or a function (see Array.prototype.sort() to know how sort function works). Default is the order returned by the server unchanged.
configUrl | Configs URL configUrl | Configs URL
parameterMacro | MUST be a function. Function to modify parameters. Accepts two arguments parameterMacro(operation, parameter). Operation is an object passed for context, remains immutable, parameter can be changed directly parameterMacro | MUST be a function. Function to set default value to parameters. Accepts two arguments parameterMacro(operation, parameter). Operation and parameter are objects passed for context, both remain immutable
modelPropertyMacro | MUST be a function. Function to set default values to each property in model. Accepts one argument modelPropertyMacro(property), property is immutable
### Plugins ### Plugins

View File

@@ -77,9 +77,6 @@ window.onload = function() {
const ui = SwaggerUIBundle({ const ui = SwaggerUIBundle({
url: "http://petstore.swagger.io/v2/swagger.json", url: "http://petstore.swagger.io/v2/swagger.json",
dom_id: '#swagger-ui', dom_id: '#swagger-ui',
parameterMacro: function (operation, parameter) {
return parameter
},
presets: [ presets: [
SwaggerUIBundle.presets.apis, SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset SwaggerUIStandalonePreset

2
dist/swagger-ui.js vendored

File diff suppressed because one or more lines are too long