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

Problem with generated specification #1

Open
damianoneill opened this issue Feb 7, 2019 · 5 comments
Open

Problem with generated specification #1

damianoneill opened this issue Feb 7, 2019 · 5 comments

Comments

@damianoneill
Copy link

Hi @bartoszm I am using the latest version of y2s-tapi-cli to generate a single swagger specification for the TAPI-2.1.1 YANG.

$ java -cp ~/Downloads/yang2swagger-tapi-cli-1.4-cli.jar com.amartus.y2s.Generator -yang-dir YANG -output tapi-2.1.1.yml &> y2s.log

y2s.log

I then use go-swagger to generate a go data model.

I used this approach previously with an older version of the tapi-cli jar (yang2swagger-tapi-cli-1.0-cli.jar) and an older version of the TAPI YANG (2.1.0) with no issues.

When running with the output of tapi-cli-1.4 against TAPI-2.1.1 I now get the following errors.

$ swagger validate tapi-2.1.1.yml

The swagger spec at "tapi-2.1.1.yml" is invalid against swagger specification 2.0.
See errors below:
- some references could not be resolved in spec. First found: object has no key "tapi.connectivity.ConnectivityService"
- definition "tapi.connectivity.getconnectionendpointdetails.output.ConnectionEndPoint" contains duplicate properties: [#/definitions/tapi.photonic.media.ConnectionEndPointAugmentation3.otsi-assembly-connection-end-point-spec]
- could not resolve reference in "/data/context/connectivity-context/".PUT to $ref : object has no key "tapi.connectivity.ConnectivityService"
- could not resolve reference in "/data/context/".PUT to $ref : object has no key "tapi.connectivity.ConnectivityService"
- could not resolve reference in "/data/context/".POST to $ref : object has no key "tapi.connectivity.ConnectivityService"
- could not resolve reference in "/data/context/connectivity-context/".POST to $ref : object has no key "tapi.connectivity.ConnectivityService"
- could not resolve reference in /data/context/connectivity-context/ to $ref : object has no key "tapi.connectivity.ConnectivityService"
- could not resolve reference in /data/context/ to $ref : object has no key "tapi.connectivity.ConnectivityService"

Running the same sequence with the latest TAPI-YANG on the develop branch results in the same issue.

Running the latest tools against the TAPI-2.1.0 YANG works fine.

So it looks like something has changed in the YANG generation from 2.1.0 to 2.1.0+ for the connectivity service generation that has introduced the problem.

Not sure how to progress, if theres anything I can help with, please just ask.

Thanks,
Damian.

@damianoneill
Copy link
Author

Hi @bartoszm checking in to see if you had a chance to look at this?

@damianoneill
Copy link
Author

Hi @bartoszm any update on this issue?

@damianoneill
Copy link
Author

@bartoszm the issue may be an ordering issue. If I add additional yang into the directory, the order in which some of the refs get written seems to get changed.

@@ -30429,9 +30475,9 @@ definitions:
  tapi.eth.OamServicePointAugmentation3:
    type: "object"
    properties:
      eth-oam-service:eth-oam-mep-service-point:
        description: "none"
        $ref: "#/definitions/tapi.eth.EthOamService""#/definitions/tapi.eth.EthOamMepServicePoint"
    x-augmentation:
      prefix: "tapi-eth"
      namespace: "urn:onf:otcc:yang:tapi-eth"

@damianoneill
Copy link
Author

If you include this yang file in your TAPI/YANG directory it will generate the issue.

https://raw.githubusercontent.com/damianoneill/tapi/v2.1.0/TAPI/YANG/tapi-network-element%402018-11-26.yang

@bartoszm
Copy link
Owner

bartoszm commented Jul 1, 2019

Hi @damianoneill for your detailed information.
I will take a look into that

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

2 participants