civisanalytics / swagger-diff

Utility for comparing two Swagger specifications.
BSD 3-Clause "New" or "Revised" License
265 stars 32 forks source link

maven swagger-diff issue - NoMethodError: undefined method `lazy' for #<Enumerator:0x230232b0> #22

Closed rajeshkamal5050 closed 8 years ago

rajeshkamal5050 commented 8 years ago

Using maven and swagger-diff gems with jruby-complete 1.7.21

    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby-complete</artifactId>
      <version>1.7.21</version>
      <scope>test</scope>
    </dependency>
[INFO] --- gem-maven-plugin:1.1.3:initialize (installing swagger-diff gems) @ sdk-docs ---
[INFO] Successfully installed swagger-diff-1.0.5
[INFO] Successfully installed swagger-core-0.2.3
[INFO] Successfully installed addressable-2.3.8
[INFO] Successfully installed hashie-3.3.2
[INFO] Successfully installed json-schema-2.6.0
[INFO] Successfully installed mime-types-2.99
[INFO] Successfully installed rspec-expectations-3.4.0
[INFO] Successfully installed rspec-support-3.4.1
[INFO] Successfully installed diff-lcs-1.2.5
[INFO] 9 gems installed
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ sdk-docs ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ sdk-docs ---
[INFO] No sources to compile
[INFO] 
[INFO] --- gem-maven-plugin:1.1.3:exec (performing the actual swagger-diff to check for backward compatibility) @ sdk-docs ---
[INFO] NoMethodError: undefined method `lazy' for #<Enumerator:0x230232b0>
[INFO]   incompatible_request_params_enumerator at /Users/kamalr/git/spring-rest-swagger/sdk/sdk-docs/target/rubygems/gems/swagger-diff-1.0.5/lib/swagger/diff/diff.rb:91
[INFO]                     requests_compatible? at /Users/kamalr/git/spring-rest-swagger/sdk/sdk-docs/target/rubygems/gems/swagger-diff-1.0.5/lib/swagger/diff/diff.rb:138
[INFO]                              compatible? at /Users/kamalr/git/spring-rest-swagger/sdk/sdk-docs/target/rubygems/gems/swagger-diff-1.0.5/lib/swagger/diff/diff.rb:10
[INFO]                                   (root) at /Users/kamalr/git/spring-rest-swagger/sdk/sdk-docs/target/rubygems/gems/swagger-diff-1.0.5/exe/swagger-diff:8
[INFO]                                     load at org/jruby/RubyKernel.java:1059
[INFO]                                   (root) at /Users/kamalr/git/spring-rest-swagger/sdk/sdk-docs/target/rubygems/bin/swagger-diff:23

Any inputs/suggestions will be great.

rajeshkamal5050 commented 8 years ago

Facing the same from the terminal as well....

10:bin kamalr$ ./swagger-diff ../../../src/main/resources/account-1.0.json ../../../src/main/resources/account.json 
NoMethodError: undefined method `lazy' for #<Enumerator:0x22bac7bc>
  incompatible_request_params_enumerator at /Users/kamalr/git/spring-rest-swagger/sdk/sdk-docs/target/rubygems/gems/swagger-diff-1.0.5/lib/swagger/diff/diff.rb:91
                    requests_compatible? at /Users/kamalr/git/spring-rest-swagger/sdk/sdk-docs/target/rubygems/gems/swagger-diff-1.0.5/lib/swagger/diff/diff.rb:138
                             compatible? at /Users/kamalr/git/spring-rest-swagger/sdk/sdk-docs/target/rubygems/gems/swagger-diff-1.0.5/lib/swagger/diff/diff.rb:10
                                  (root) at /Users/kamalr/git/spring-rest-swagger/sdk/sdk-docs/target/rubygems/gems/swagger-diff-1.0.5/exe/swagger-diff:8
                                    load at org/jruby/RubyKernel.java:1087
                                  (root) at ./swagger-diff:23
10:bin kamalr$ ruby -v
jruby 1.7.19 (1.9.3p551) 2015-01-29 20786bd on Java HotSpot(TM) 64-Bit Server VM 1.8.0_60-b27 +jit [darwin-x86_64]
jeffreyc commented 8 years ago

Thank you for your feedback! Support for MRI 1.9.3 ended a year ago, so swagger-diff wasn't written with Ruby 1.9.3 in mind, and uses features not present in Ruby 1.9.3. Unfortunately, this includes JRuby 1.7.x. swagger-diff supports JRuby 9.0.4.0, so it should work without issue if you're able to update. We'll update swagger-diff to make this requirement explicit.

rajeshkamal5050 commented 8 years ago

Thanks will @jeffreyc try with JRuby 9.0.4.0 and update here.

One more question. Is there a way using the Swagger-Diff to do this,

  1. Delta of the NEW API's/Models which got added between different API versions and present it to the user as these are the new API Features?
jeffreyc commented 8 years ago

Delta of the NEW API's/Models which got added between different API versions and present it to the user as these are the new API Features?

Generating a list of new endpoints/parameters is not currently supported, but it should be relatively simple, and is something we have talked about adding. However, we're not currently working on that feature, and would welcome a PR adding this functionality.

rajeshkamal5050 commented 8 years ago

Sure will add a PR.

jeffreyc commented 8 years ago

It's been two weeks, so I'm going to trust that upgrading to JRuby 9.0.4.0 fixed your problem and close this issue. If you encounter additional problems, please either comment on this issue or create a new issue as appropriate. Thanks again for your feedback!