Skip to content

feat: add Warning http response deprecation notices #2253

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

Merged
merged 2 commits into from
Apr 11, 2025

Conversation

zone117x
Copy link
Member

@zone117x zone117x commented Apr 7, 2025

Adds a Warning: 299 - "Deprecated ..." http response header for endpoints marked as deprecated. This should help with developer awareness.

E.g.

curl -i 'https://api.hiro.so/extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/stx'
HTTP/2 200 
date: Mon, 07 Apr 2025 12:19:21 GMT
...
warning: 299 - "Deprecated: See https://docs.hiro.so/stacks/api for more information"
...

There are no deprecation-related http headers available and widely in-use today, however, this one is at least RFC spec-compliant


This is implemented as a generic Fastify plugin, and is a good candidate to port over to our api-toolkit repo.

Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/api/deprecation-plugin.ts 92.85% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link

github-actions bot commented Apr 7, 2025

Vercel deployment URL: https://stacks-blockchain-n5l1jifc7-hirosystems.vercel.app 🚀

Copy link
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

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

Great idea! I agree this should eventually be moved to the toolkit

@zone117x zone117x merged commit e62ce79 into develop Apr 11, 2025
25 of 26 checks passed
@zone117x zone117x deleted the feat/http-deprecation-notices branch April 11, 2025 06:25
hirosystems-release-bot bot added a commit that referenced this pull request Apr 18, 2025
## [8.10.0](v8.9.0...v8.10.0) (2025-04-18)

### Features

* add `Warning` http response deprecation notices ([#2253](#2253)) ([e62ce79](e62ce79))

### Bug Fixes

* optimize contract event list db index ([#2258](#2258)) ([e1044d1](e1044d1))
* optimize query for transactions in block ([#2259](#2259)) ([e69f9e4](e69f9e4))
@hirosystems-release-bot
Copy link
Contributor

🎉 This PR is included in version 8.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants