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

Getting a runtime error while trying to compare two yaml file #182

Closed
Sourabh25 opened this issue Oct 13, 2020 · 6 comments
Closed

Getting a runtime error while trying to compare two yaml file #182

Sourabh25 opened this issue Oct 13, 2020 · 6 comments

Comments

@Sourabh25
Copy link

Sourabh25 commented Oct 13, 2020

getting the below error:

Exception in thread "main" java.lang.RuntimeException: Cannot read old OpenAPI spec
	at com.qdesrame.openapi.diff.core.OpenApiCompare.notNull(OpenApiCompare.java:106)
	at com.qdesrame.openapi.diff.core.OpenApiCompare.fromSpecifications(OpenApiCompare.java:101)
	at com.qdesrame.openapi.diff.core.OpenApiCompare.fromLocations(OpenApiCompare.java:90)
	at com.qdesrame.openapi.diff.core.OpenApiCompare.fromLocations(OpenApiCompare.java:77)
	at com.comcast.ymldiff.App.main(App.java:18)

both are valid yaml file.

@jimschubert
Copy link
Member

@Sourabh25 can you provide minimal reproducible specs for new and old specs, as well as how you're invoking?

@Sourabh25
Copy link
Author

Sourabh25 commented Oct 14, 2020

@jimschubert I was not able to attach the .yaml files as this type is not supported to be uploaded.
here is the content of the file

 spring: 
  application: 
    name: xyz
  cloud: 
    config: 
      enabled: true
      failFast: true
      label: master
      uri: "http://configserver001.dt-u2.cf.abc.net"
  profiles: 
    active: dev

Please find below the code

public class App {

    public static final String OPENAPI_DOC1 = "bootstrap.yaml";
    public static final String OPENAPI_DOC2 = "bootstrap1.yaml";


    public static void main(String[] args) {
        ChangedOpenApi changedOpenApi = OpenApiCompare.fromLocations(OPENAPI_DOC1, OPENAPI_DOC2);

    }

}

Kindly let me know if you need any more information.

@jimschubert
Copy link
Member

@Sourabh25 this project compares OpenAPI Specification documents. What you've provided is a spring yaml configuration. I'd recommend finding your OpenAPI document(s) and try again, and this should solve your issue.

@Sourabh25
Copy link
Author

okay with open api spec yaml file this is working.

@Sourabh25 Sourabh25 changed the title Getting a runtime error while trying to compare to yaml file Getting a runtime error while trying to compare two yaml file Oct 14, 2020
@Swap3093
Copy link

I also Facing same issue can not read old/new open API spe in Restest JAVA ......any solution

@joschi
Copy link
Contributor

joschi commented Nov 21, 2022

@Swap3093 Please open a new topic in the Discussions of this project and provide as much information as possible, such as the exact version of openapi-diff you're using and the OpenAPI specs which cause the issue.

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

4 participants