Improve spec error messaging

This commit is contained in:
Kyle Shockey
2017-04-05 15:42:22 -07:00
parent 8b64f475d7
commit 8bae745f78
8 changed files with 29 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"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;AAokCA;AA0/CA;AAgxEA;AAq9FA;;;;;;;;;AA4zBA;AA2zIA;AAi4DA;AA6tDA","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;AAokCA;AA0gDA;AA+vEA;AA49FA;;;;;;;;;AAk0BA;AA2zIA;AAi4DA;AA6tDA","sourceRoot":""}

File diff suppressed because one or more lines are too long

2
dist/swagger-ui.css vendored

File diff suppressed because one or more lines are too long

6
dist/swagger-ui.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAmwCA;AAoyHA;AA2wHA;AA07FA;AAmnCA;AAu/BA;AAoiCA;AA+4BA","sourceRoot":""} {"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAmwCA;AAoyHA;AA2wHA;AA07FA;AAmnCA;AAu/BA;AA0iCA;AAu4BA","sourceRoot":""}

View File

@@ -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") }&nbsp;{ locationMessage }</h4>
<span style={{ whiteSpace: "pre-line"}}>{ error.get("message") }</span> <span style={{ whiteSpace: "pre-line"}}>{ error.get("message") }</span>
<div> <div>
{ jumpToLine ? ( { jumpToLine ? (

View File

@@ -24,6 +24,11 @@
@include text_code(); @include text_code();
} }
small
{
color: #666;
}
} }
hgroup hgroup