Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Finished JSON Schema serialization #552

Merged
merged 2 commits into from
Jul 10, 2018
Merged

Finished JSON Schema serialization #552

merged 2 commits into from
Jul 10, 2018

Conversation

tjanc
Copy link
Contributor

@tjanc tjanc commented Jun 8, 2018

  • adds support for Object
  • adds support for nullable
  • fixes some inconsistencies
  • hooks in new serialization

@tjanc tjanc force-pushed the tjanc/schema-object branch 5 times, most recently from 721e515 to e3ff353 Compare June 11, 2018 15:45
Copy link
Contributor

@klokane klokane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good. But sometime have problem with readability

Typical in indentation. Will add comments

auto it = find(str->get().get());
if (it != end())
erase(it);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cascade is little bit confusing while reading

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just checks whether we are adding a MemberElement with StringElement key so we ensure uniqueness - if the key is already encountered, it shall be removed. Specific suggestions how to rewrite this?

@goganchic
Copy link
Contributor

Great work! But would you please split all changes into small commits? E.g. you can extract refactoring staff like this https://github.com/apiaryio/drafter/pull/552/files#diff-b3cd98f0ba049e7bdc9ae6c68e9e1345L17 into separate commit. I think small commits will be much more easier to check and understand.

@@ -57,10 +57,6 @@ void MarkdownParser::parse(const ByteBuffer& source, MarkdownNode& ast)
m_source = NULL;
m_sourceLength = 0;
m_listBlockContext = false;

#ifdef DEBUG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is DEBUG removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the dump there is
a) pretty hacky
b) messes up standard output
c) useless.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we have an alternative, please don't remove it. It's pretty useful when debugging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still convinced writing debug information to standard output out of nowhere is a bit too hacky. You can always log like this:

LOG(debug) << "Hello " << 42 << " or some other value";

This amounts to the same thing but can be dynamically turned on with a flag: drafter -L or drafter --enable-log. Also, it logs into the file drafter.log instead of polluting standard output. If needed, the ENABLE_LOGGING macro can be used to force logging while debugging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shall be solved in a future PR, for now I'm reverting the change.

@kylef
Copy link
Member

kylef commented Jul 9, 2018

@tjanc can you please rebase this on master so it will trigger the new CircleCI tests.

@tjanc tjanc force-pushed the tjanc/schema-object branch 2 times, most recently from 60c2638 to cfbc4d6 Compare July 10, 2018 12:09
@tjanc tjanc force-pushed the tjanc/schema-object branch from cfbc4d6 to 81573ee Compare July 10, 2018 14:10
@tjanc tjanc merged commit 4e9cdb9 into master Jul 10, 2018
@kylef kylef deleted the tjanc/schema-object branch July 10, 2018 14:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants