kuberig-io / kuberig-dsl

KubeRig DSL generation code
https://kuberig.io
Apache License 2.0
8 stars 0 forks source link

knative eventing DSL generation fails #19

Closed teyckmans closed 3 years ago

teyckmans commented 3 years ago

When trying to generate the DSL from the swagger file generated from the knative/eventing Go code the DSL generation fails on the knative.duck.dev.v1alpha1.Subscribable:

Generated Kotlin code:

package knative.duck.dev.v1alpha1

import io.kuberig.dsl.model.BasicResource
import knative.duck.dev.v1alpha1.SubscriberSpec

/**
 * Subscribable is the schema for the subscribable portion of the spec section of the resource.
 **/
open class Subscribable(

    val subscribers : List<SubscriberSpec>?) : BasicResource(kind, apiVersion)

Previously I had already encountered types that did not have any attributes but were kinds and had to extend BasicResource but at the time I didn't anticipate for types that would have attributes but not the required kind and apiVersion attributes.

So we need to improve the handling to check for the absense of the kind and apiVersion attribute separately.