Coder Social home page Coder Social logo

Comments (16)

alejandro-vericatch avatar alejandro-vericatch commented on June 2, 2024 8

Hey guys, could you release the fixes #115? I would appreciate it. Thanks!

from apitome.

ukazap avatar ukazap commented on June 2, 2024 5

Update the Gemfile for temporary fix:

gem "apitome", github: "jejacks0n/apitome"

from apitome.

bf4 avatar bf4 commented on June 2, 2024 4

I made a PR #115

gonna test it in my app

from apitome.

ShamoX avatar ShamoX commented on June 2, 2024 1

@jejacks0n Can you release the fix please ?
I made a PR #118 that fixes the build

from apitome.

daviidy avatar daviidy commented on June 2, 2024 1

Update the Gemfile for temporary fix:

gem "apitome", github: "jejacks0n/apitome"

It worked for me. Thanks!

from apitome.

bf4 avatar bf4 commented on June 2, 2024

fwiw, I'm researching this now myself. looks like you're on rails 6.0.2.1. I'm on Rails 5.2. did you just upgrade rails? have you ever had it working?

from apitome.

jejacks0n avatar jejacks0n commented on June 2, 2024

Any fix for this would be appreciated. =) I currently don't have time to look into it.

from apitome.

bf4 avatar bf4 commented on June 2, 2024

I think this is a duplicate of #113

from apitome.

bf4 avatar bf4 commented on June 2, 2024

Issue for me appears to be that rspec_api_documentation may return the string "[binary data]" as the response body, and this makes apitome blow up.

https://github.com/zipmark/rspec_api_documentation/blob/560c3bdc7bd5581e7c223334390221ecfc910be8/lib/rspec_api_documentation/client_base.rb#L88-L96

I'd like to propose adding a user-configurable error handler to handle this in addition to a fix

either in the controller

def formatted_body(body, type)
if type =~ /json/ && body.present?
JSON.pretty_generate(JSON.parse(body))
else
body
end
rescue JSON::ParserError
return body if body == " "
raise JSON::ParserError
end

or in the view which knows which request is the problematic one

<% example['requests'].each_with_index do |request, index| %>
<div id="<%= "request-#{index}" %>">
<h3><%= t(:request, scope: :apitome) %></h3>
<div class="request">
<%= render partial: 'apitome/docs/route', locals: {request: request, index: index} %>
<%= render partial: 'apitome/docs/headers', locals: {request: request, index: index, headers: request['request_headers']} %>
<%= render partial: 'apitome/docs/query', locals: {request: request, index: index} unless request['request_query_parameters'].empty? %>
<%= render partial: 'apitome/docs/body', locals: {request: request, index: index, body: request['request_body'], type: request['request_content_type']} if request['request_body'] %>
<%= render partial: 'apitome/docs/curl', locals: {request: request, index: index} if request['curl'] %>
</div>
<h3><%= t(:response, scope: :apitome) %></h3>
<div class="response">
<%- if Apitome.configuration.simulated_response %>
<%= link_to('Simulated Response', simulated_path(example[:link])) if example[:link].present? %>
<%- end %>
<%= render partial: 'apitome/docs/response_fields', locals: {params: example['response_fields']} if example['response_fields'].size > 0 %>
<%= render partial: 'apitome/docs/status', locals: {request: request, index: index} %>
<%= render partial: 'apitome/docs/headers', locals: {request: request, index: index, headers: request['response_headers']} %>
<%= render partial: 'apitome/docs/body', locals: {request: request, index: index, body: request['response_body'], type: request['response_content_type']} if request['response_body'] %>
</div>

from apitome.

KiranJosh avatar KiranJosh commented on June 2, 2024

fwiw, I'm researching this now myself. looks like you're on rails 6.0.2.1. I'm on Rails 5.2. did you just upgrade rails? have you ever had it working?

I have integrated apitome in new app only. It was working before upgrading rspec-rails to 4.0.0.

from apitome.

KiranJosh avatar KiranJosh commented on June 2, 2024

I made a PR #115

gonna test it in my app

Thanks, its working.

from apitome.

bf4 avatar bf4 commented on June 2, 2024

Issue was a change in rack and naive logic in rspec api doc with poor handling in apitome

from apitome.

Payal13 avatar Payal13 commented on June 2, 2024

I am facing the same issue. What should I do ? is this fix released?

from apitome.

alejandro-vericatch avatar alejandro-vericatch commented on June 2, 2024

I am facing the same issue. What should I do ? is this fix released?

Have a look at issue #115, there fix the problem.

from apitome.

ratnarajsukale avatar ratnarajsukale commented on June 2, 2024

gem "apitome", github: "jejacks0n/apitome"
this works

from apitome.

xrnm avatar xrnm commented on June 2, 2024

Seeing as #115 has been merged should this be marked as closed?

from apitome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.