swagger-api / apidom

Semantic parser for API specifications
https://swagger-api.github.io/apidom/
69 stars 18 forks source link

AsyncAPI: add support for replacing empty elements for nested structures in bindings object #1152

Open char0n opened 2 years ago

char0n commented 2 years ago

As bindings objects can have internal nested structures, we can support those nested structures via NCEs (Non Concrete Elements). Current plugin for replacing empty elements only recognizes bindings as objects of arbitrary shape. But they actually have a prescribed shape and we can add support for them.

frantuma commented 2 years ago

@char0n can you add an exapmple of such "nested structure"? At the moment we support e.g. completion also for empty bindings instances, e.g.

asyncapi: '2.2.0'
components:
  messages:
    lightMeasured:
      name: lightMeasured
      bindings: 
        http: 

this works because the empty value for http is recognized as element http-message-binding. Is that strucure you meant, or internal to the binding?

char0n commented 2 years ago

@frantuma the bindings itself has internal structure. Here is an example: https://github.com/asyncapi/bindings/tree/master/solace