Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting allOf and #532

Closed
nicklasb opened this issue Sep 1, 2015 · 3 comments
Closed

Supporting allOf and #532

nicklasb opened this issue Sep 1, 2015 · 3 comments

Comments

@nicklasb
Copy link
Member

nicklasb commented Sep 1, 2015

So, I doesn't seem like ASF supports allOf when it comes to properties, it assumes that the properties are in a top "property"-attribute:

          scope.$watch(function() {
            var schema = scope.schema;
            var form = scope.initialForm || defaultForm;
            if (form && schema && schema.type && (lastDigest.form !== form || lastDigest.schema !== schema) && Object.keys(schema.properties).length > 0) {
              lastDigest.schema = schema;
              lastDigest.form = form;
              render(schema, form);
            }
          });

But the common approach to inheritance in JSON-schema seems to be:

"allOf": 
[
    {properties: {"$ref": "def.json/properites"}},
    {properties: {"field": "string"}}
]

So something should perhaps pre-parse the schema properties into something more digestable for the above code? Or is there some other approach? Actually I think it is a little bit difficult to interpret the standards with regards to remote $refs.

@nicklasb
Copy link
Member Author

nicklasb commented Sep 2, 2015

I have currently worked around it by having my backend resolve it the schemas into having just properties instead. I suppose that this could be done at the frontend(in ASF as TV4 doesn't seem to mind allOf) as well, obviously. If anyone wanted to know.

@AndreNel7
Copy link

example workaround

@nicklasb
Copy link
Member Author

ASF will get *Of-support any of in a 1.x version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants