Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Support "$ref": "{{model:MyModel}}" #58

Merged
merged 1 commit into from
Oct 12, 2017
Merged

Conversation

mjmac
Copy link
Contributor

@mjmac mjmac commented Oct 10, 2017

Dynamically inserts references to the model.

Dynamically inserts references to the model.
@codecov-io
Copy link

Codecov Report

Merging #58 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #58   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      5    +1     
  Lines         247    276   +29     
  Branches       31     37    +6     
=====================================
+ Hits          247    276   +29
Impacted Files Coverage Δ
src/models.spec.js 100% <100%> (ø)
src/models.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0f280d...ee375db. Read the comment docs.

@tchock
Copy link
Contributor

tchock commented Oct 12, 2017

Awesome!

@tchock tchock merged commit 949340f into deliveryhero:master Oct 12, 2017
@tchock tchock mentioned this pull request Oct 12, 2017
@mjmac mjmac deleted the modelrefs branch October 12, 2017 13:26
@mjmac mjmac restored the modelrefs branch October 12, 2017 13:27
@ShaunEgan
Copy link

ShaunEgan commented Oct 18, 2017

Any idea on when this might be released?

@tchock
Copy link
Contributor

tchock commented Oct 18, 2017

@ShaunEgan I wanted to do something for this on the weekend. There is another ticket I want to include into 1.0. But if I couldn't get to that point I would release it already.

@ShaunEgan
Copy link

Great, thanks

@ShaunEgan
Copy link

ShaunEgan commented Oct 20, 2017

So this doesn't work when doing validation using ajv as it doesn't understand the references - do you have a suggested solution for validation with this plugin?

@mjmac
Copy link
Contributor Author

mjmac commented Oct 20, 2017

I don't have experience with ajv, but I looked at its docs quickly. It does support $ref, which is part of the standard, but I can see why it would get confused by the unprocessed references.

I can't really think of a great solution. We could change this feature so that instead of $ref we use a different keyword ('awsref'?), and then at least things which are expecting a real reference won't get confused. But I don't think that really solves your problem, which is that you want to do validation using composition of the unprocessed model definitions. I think you're going to have to pick one way of doing it or the other. I am holding out hope that AWS adds support for enabling validation via CloudFormation soon.

@vmtzkr
Copy link

vmtzkr commented Nov 1, 2017

Could you please publish a new version on npm?

@tchock
Copy link
Contributor

tchock commented Nov 1, 2017

Yes, will do this today

@tchock
Copy link
Contributor

tchock commented Nov 1, 2017

@vilius-rugaitis Released with version 1.0 :)

@vmtzkr
Copy link

vmtzkr commented Nov 2, 2017

Somehow, I cannot update the package over npm. Or does npm have some kind of update review processes?
bildschirmfoto 2017-11-02 um 08 53 18

@tchock
Copy link
Contributor

tchock commented Nov 2, 2017

@vilius-rugaitis Oh, my bad. thought this package had an automated publishing process in travis ci.
Have published it manually now :)

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