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

Fix extend element #247

Merged
merged 5 commits into from
Mar 9, 2016
Merged

Fix extend element #247

merged 5 commits into from
Mar 9, 2016

Conversation

klokane
Copy link
Contributor

@klokane klokane commented Mar 7, 2016

This patch fix recent issues around "ExtendElement"
Fix #217 #245

  • Registration of NamedTypes now happens in "two steps"
  • create and registrate empty refract element with correct type info
  • create element with complex info (meta/attrs/content)

This solution will allow knowledge correct type info of referenced
element, so later while element is expanded we will receive correct
base element type for extend element merging

  • Correctly handle deeper dependencies in registry for nested types definition
  • Add ability to correctly handle complex types for nested type definition like - type (array[Comlex, Types])

Jiri Kratochvil added 3 commits March 3, 2016 10:51
Add ability to corectly handle complex types for nested types
type definition like `- type (array[Comlex, Types])`

Correctly handle deeper dependencies in registry for nested types
definition
Registaration of NamedTypes now happens in "two steps"
- create and registrate empty refract element with correct type info
- create element with complex info (meta/attrs/content)

This solution will allow knowledge correct type info of referenced
element, so later while element is expanded we will receive correct
base element type for extend element merging

Additional changes:
- Extract RefractElementFactory into file
std::cout << "==BASE TYPE ORDER==" << std::endl;
#endif /* DEBUG_DEPENDENCIES */

#if 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove this #ifdef

@Baggz
Copy link

Baggz commented Mar 8, 2016

❤️

"attributes": {
"contentType": "application/schema+json"
},
"content": "{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"loc\": {}\n }\n}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Schema is incorrect it should be an array, it probably is a bug and should be a separate fix

Copy link
Contributor

Choose a reason for hiding this comment

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

@w-vi Can you please create an issue so we don't forget this? Thanks.

@w-vi
Copy link
Contributor

w-vi commented Mar 9, 2016

@klokane @pksunkara Apart from the test comments I think it's good to go

@klokane
Copy link
Contributor Author

klokane commented Mar 9, 2016

Ok, so I will cut extend/circular.apib and we can go

Cleanup forgoted `#ifdef`
@klokane klokane force-pushed the klokane/fix-extend-element branch from 2332d02 to d6e34c6 Compare March 9, 2016 10:06
@klokane
Copy link
Contributor Author

klokane commented Mar 9, 2016

Updated

@w-vi
Copy link
Contributor

w-vi commented Mar 9, 2016

@pksunkara If you have nothing more to add please merge as I'm cool with the current state

using namespace refract;
using namespace drafter;

TEST_CASE("Create empty primitive element","[ElementFactory]") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the { be in new lines for the tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are in test-ApplyVisitorTest.cc in same position.
But we should finally create clang-format config and add into repo

@pksunkara
Copy link
Contributor

Reviewed.

@klokane
Copy link
Contributor Author

klokane commented Mar 9, 2016

@pksunkara can you please do ALL STYLE RELATED comments in one "turn"
It is really tedious make again and again rebase and push force just with style changes

@pksunkara
Copy link
Contributor

@klokane Sorry, But I do the style comments when I go through the code. :(

pksunkara added a commit that referenced this pull request Mar 9, 2016
@pksunkara pksunkara merged commit b641e69 into master Mar 9, 2016
@pksunkara pksunkara deleted the klokane/fix-extend-element branch March 9, 2016 14:19
@w-vi
Copy link
Contributor

w-vi commented Mar 9, 2016

Again style discussion, please @pksunkara have a look at apiaryio/snowcrash#360 and give it a try so we can start using it

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.

JSON Schema generator fails on ExtendElement in enum
4 participants