Merge pull request #2865 from shockey/bug/no-line-numbers-without-jumptoline
Improve spec error messaging
This commit is contained in:
91
dist/swagger-ui-bundle.js
vendored
91
dist/swagger-ui-bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/swagger-ui-bundle.js.map
vendored
2
dist/swagger-ui-bundle.js.map
vendored
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AAsdA;AAkoJA;AAyiCA;;;;;AAskCA;AA66IA;AA27FA;AAuwGA;AAymEA;AAm+CA;AA+/CA;AA+rCA;AA65DA;AAs0IA;;;;;;;;;;;;;;AAgyFA;AAyoIA;AAiuJA;AA8kHA;AAonGA;AAukEA;AA02DA;AAk2EA;AAi2GA;;;;;;AA+zEA;AAq2FA;;;;;AA23CA;AA2qFA;AAo2CA;AAqkCA;AA0gDA;AA6vEA;AAu9FA;;;;;;;;;AA6zBA;AA2zIA;AAi4DA;AA6tDA;;;;;;AAg3BA;AA8iHA;AAipGA","sourceRoot":""}
|
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AAsdA;;;;;;AAoIA;AAk7FA;AAmtCA;;;;;AA0uIA;AA66IA;AA27FA;AAuwGA;AAilFA;AAikFA;AAs9CA;AA8jDA;AA2qCA;AA4tEA;AAgkIA;;;;;;;;;;;;;;AAw4GA;AAyoIA;AAiuJA;AA8kHA;AAonGA;AAukEA;AA02DA;AAyxDA;AAi9BA;;;;;;AAqtEA;AAg0FA;;;;;AA01CA;AA2qFA;AAo2CA;AAqkCA;AA0/CA;AA2wEA;AA49FA;;;;;;;;;AAs0BA;AA2zIA;AAi4DA;AA6tDA","sourceRoot":""}
|
||||||
2
dist/swagger-ui-standalone-preset.js
vendored
2
dist/swagger-ui-standalone-preset.js
vendored
File diff suppressed because one or more lines are too long
2
dist/swagger-ui.css
vendored
2
dist/swagger-ui.css
vendored
File diff suppressed because one or more lines are too long
6
dist/swagger-ui.js
vendored
6
dist/swagger-ui.js
vendored
File diff suppressed because one or more lines are too long
2
dist/swagger-ui.js.map
vendored
2
dist/swagger-ui.js.map
vendored
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAmwCA;AAoyHA;AA2wHA;AA07FA;AAmnCA;AAw/BA;AAoiCA;AAi4BA","sourceRoot":""}
|
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAmwCA;AAoyHA;AA2wHA;AA07FA;AAmnCA;AAw/BA;AAwiCA;AA+3BA","sourceRoot":""}
|
||||||
@@ -77,11 +77,23 @@ const ThrownErrorItem = ( { error, jumpToLine } ) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const SpecErrorItem = ( { error, jumpToLine } ) => {
|
const SpecErrorItem = ( { error, jumpToLine } ) => {
|
||||||
|
let locationMessage = null
|
||||||
|
|
||||||
|
if(error.get("path")) {
|
||||||
|
if(List.isList(error.get("path"))) {
|
||||||
|
locationMessage = <small>at { error.get("path").join(".") }</small>
|
||||||
|
} else {
|
||||||
|
locationMessage = <small>at { error.get("path") }</small>
|
||||||
|
}
|
||||||
|
} else if(error.get("line") && !jumpToLine) {
|
||||||
|
locationMessage = <small>on line { error.get("line") }</small>
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="error-wrapper">
|
<div className="error-wrapper">
|
||||||
{ !error ? null :
|
{ !error ? null :
|
||||||
<div>
|
<div>
|
||||||
<h4>{ toTitleCase(error.get("source")) + " " + error.get("level") }{ error.get("path") ? <small> at {List.isList(error.get("path")) ? error.get("path").join(".") : error.get("path")}</small>: null }</h4>
|
<h4>{ toTitleCase(error.get("source")) + " " + error.get("level") } { locationMessage }</h4>
|
||||||
<span style={{ whiteSpace: "pre-line"}}>{ error.get("message") }</span>
|
<span style={{ whiteSpace: "pre-line"}}>{ error.get("message") }</span>
|
||||||
<div>
|
<div>
|
||||||
{ jumpToLine ? (
|
{ jumpToLine ? (
|
||||||
|
|||||||
@@ -24,6 +24,11 @@
|
|||||||
|
|
||||||
@include text_code();
|
@include text_code();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
small
|
||||||
|
{
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hgroup
|
hgroup
|
||||||
|
|||||||
Reference in New Issue
Block a user