swagger-parser icon indicating copy to clipboard operation
swagger-parser copied to clipboard

Not possible to have "allOf" definitions merged?

Open nakamorichi opened this issue 9 years ago • 9 comments

Is it not possible to destructure "allOf" array? I want the object definitions in the array be merged into a single "properties" object.

nakamorichi avatar Oct 21 '16 06:10 nakamorichi

This feature was considered previously, but I decided not to implement it because it wouldn't comply with the spec. See https://github.com/BigstickCarpet/json-schema-ref-parser/issues/1#issuecomment-145652500

JamesMessinger avatar Oct 21 '16 11:10 JamesMessinger

It may not comply with the spec, but I have a bunch of dependencies that are failing because they have no idea how to handle "allOf". I figured it would be easiest if I could just merge them using swagger-parser. Wouldn't it be possible even to add an experimental feature for the purpose?

nakamorichi avatar Oct 25 '16 09:10 nakamorichi

I'm going to re-open this issue to serve as a feature request. I'm currently working on a new version of Swagger Parser that will allow third-party plug-ins that add functionality exactly like this. I'll probably go ahead and create a plugin that does this, since multiple people have asked for it, and it'll be a good demonstration of how to author plug-ins.

JamesMessinger avatar Oct 25 '16 12:10 JamesMessinger

@BigstickCarpet Just wondering if you've made any progress on implementing the third-party plugin system for the new Swagger parser, and the plugin for allowing the merge of AllOf definitions?

We're very keen to use this once it's available.

jcdarwin avatar Jan 25 '17 03:01 jcdarwin

@jcdarwin - I haven't had a chance to work on it yet. A few other projects have needed my time instead. But soon! :)

JamesMessinger avatar Jan 25 '17 15:01 JamesMessinger

Stumbled upon this also on BigstickCarpet/swagger-express-middleware#102

copitz avatar Feb 08 '18 11:02 copitz

@jcdarwin - I haven't had a chance to work on it yet. A few other projects have needed my time instead. But soon! :)

Is that still under consideration?

omriarnon-s1 avatar Feb 19 '19 19:02 omriarnon-s1

@sepiol, our next priority is adding support for OpenAPI v3.

rkrauskopf avatar Mar 06 '19 14:03 rkrauskopf

@jcdarwin - I haven't had a chance to work on it yet. A few other projects have needed my time instead. But soon! :)

any updates on this?

lucasassisrosa avatar May 08 '20 22:05 lucasassisrosa

Gotta respect the spec. If tools don't know what allOf is they need to be updated.

philsturgeon avatar Aug 18 '23 18:08 philsturgeon

Gotta respect the spec. If tools don't know what allOf is they need to be updated.

Why did you close the issue then? Is this library going to be updated with regards to allOf?

Fruetel avatar Mar 05 '24 10:03 Fruetel

It's not going to be built.

philsturgeon avatar Mar 05 '24 10:03 philsturgeon