This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Bad Error Message #547
Comments
You have done something wrong. |
ok, thanks! |
No, we need to keep this open to have a better error message. |
ok |
The following patch will restore Drafter 3.2.7 behaviour. Although I do not think this is correct and we should likely catch the problem earlier. I think diff --git a/src/refract/VisitorUtils.cc b/src/refract/VisitorUtils.cc
index 8192a8c9..6a1d2b08 100644
--- a/src/refract/VisitorUtils.cc
+++ b/src/refract/VisitorUtils.cc
@@ -27,7 +27,9 @@ std::string refract::GetKeyAsString(const MemberElement& e)
auto element = e.get().key();
if (auto str = TypeQueryVisitor::as<const StringElement>(element)) {
- return str->get();
+ if (!str->empty()) {
+ return str->get();
+ }
}
if (auto ext = TypeQueryVisitor::as<const ExtendElement>(element)) { |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've opened MSON specification and found such example https://github.com/apiaryio/mson/blob/master/MSON%20Specification.md#232-value-member-types so I've created such piece of code:
I use drafter from master and it reports me such an error:
Is it bug or I've done something wrong?
P.s. such example works fine:
The text was updated successfully, but these errors were encountered: