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

Middleware that adds hash of apidoc into response headers #215

Merged
merged 1 commit into from
Mar 3, 2014

Conversation

mbacovsky
Copy link
Contributor

No description provided.

@@ -266,6 +268,18 @@ def reload_documentation
end
end

def documentation_tag
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about digest or checksum instead of tag? I had little problem understanding the code with this naming

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I like checksum more, I'll rename it.

@mbacovsky
Copy link
Contributor Author

I'd like to trigger tag_documentation also in development mode when the API source was changed and reloaded. Is there good place in the code where to put this? Make it optional in apipie config perhaps?

@iNecas
Copy link
Member

iNecas commented Feb 28, 2014

Where is the middleware registered? If it needs manual registration, it should be noted in the documentation. The documentation should be update anyway to cover this possiblity

@iNecas
Copy link
Member

iNecas commented Feb 28, 2014

@mbacovsky probably here would be the right place for the recallcuation: https://github.com/Apipie/apipie-rails/blob/master/lib/apipie/application.rb#L259

@mbacovsky
Copy link
Contributor Author

The middleware needs manual registration as noted in comments in code. I can move this to the docs as well.

@iNecas
Copy link
Member

iNecas commented Feb 28, 2014

If the middleware needs to be rigestered manually, it probably doesn't make sense to have the apidoc_tag configuration. When I don't want to include the checksums, I will just not load the middleware. Or is there other usage?

@mbacovsky
Copy link
Contributor Author

The patch was updated. apidoc_tag was removed, tags were renamed to checksums. Checksum is computed during reload_documentation if allowed in configuration (update_checksum => true)

I'll add some info in documentation.

@iNecas
Copy link
Member

iNecas commented Feb 28, 2014

Looks good so far, pending docs


.. code::

"Apipie-Apidoc-Checksum"=>"fb81460e7f4e78d059f826624bdf9504"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about "Apipie-Checksum" to make it a bit shorter?

@iNecas
Copy link
Member

iNecas commented Mar 3, 2014

Nice!

iNecas added a commit that referenced this pull request Mar 3, 2014
Middleware that adds hash of apidoc into response headers
@iNecas iNecas merged commit 1f3e6de into Apipie:master Mar 3, 2014
@iNecas
Copy link
Member

iNecas commented Mar 3, 2014

Released in 0.1.0. Thank you for your help!

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

Successfully merging this pull request may close these issues.

2 participants