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

Feature Request: Add parameter decorator @cookie to specify that is in: cookie #4739

Closed
3 tasks done
su8ru opened this issue Oct 15, 2024 · 2 comments · Fixed by #4761
Closed
3 tasks done

Feature Request: Add parameter decorator @cookie to specify that is in: cookie #4739

su8ru opened this issue Oct 15, 2024 · 2 comments · Fixed by #4761
Assignees
Labels
design:needed A design request has been raised that needs a proposal lib:http triaged:core

Comments

@su8ru
Copy link
Contributor

su8ru commented Oct 15, 2024

Clear and concise description of the problem

There is no way to decorate parameters in the cookie.
So, add @cookie decorator like @header to decorate the parameter is in the cookie.

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@markcowl
Copy link
Contributor

  • note that contribution does not contain openapi3 support, which would be needed

@su8ru
Copy link
Contributor Author

su8ru commented Oct 17, 2024

@markcowl I think #4761 will include openapi3 support to fix type errors.
If it seems that other libraries also need to be supported, I am thinking of removing the close keyword from #4761 and unlinking it to leave this issue, what do you think?

github-merge-queue bot pushed a commit that referenced this issue Nov 1, 2024
…#4761)

close #4739 

- `@typespec/http`
  - add `@cookie` decorator to decorate parameters as cookie parameters
  - add `response-cookie-not-supported` diagnostics
    - to be emitted when response cookies are specified
  - add tests for cookie params
- `@typespec/http-server-javascript`
  - throw UnimplementedError when cookie params came
- `@typespec/openapi3`
  - support cookie param case
  - add tests for cookie params
  
### response cookie design

| in | explicit body | implicit body |
| - | - | - |
| diagnostics | `metadata-ignored` | `response-cookie-not-supported` |
| result | included (unified with other metadata) | NOT included
(prevent breaking change for `set-cookie`) |

---

based on:
- #4721

---------

Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>
Co-authored-by: Timothee Guerin <tiguerin@microsoft.com>
swatkatz pushed a commit to swatkatz/typespec that referenced this issue Nov 5, 2024
…microsoft#4761)

close microsoft#4739 

- `@typespec/http`
  - add `@cookie` decorator to decorate parameters as cookie parameters
  - add `response-cookie-not-supported` diagnostics
    - to be emitted when response cookies are specified
  - add tests for cookie params
- `@typespec/http-server-javascript`
  - throw UnimplementedError when cookie params came
- `@typespec/openapi3`
  - support cookie param case
  - add tests for cookie params
  
### response cookie design

| in | explicit body | implicit body |
| - | - | - |
| diagnostics | `metadata-ignored` | `response-cookie-not-supported` |
| result | included (unified with other metadata) | NOT included
(prevent breaking change for `set-cookie`) |

---

based on:
- microsoft#4721

---------

Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>
Co-authored-by: Timothee Guerin <tiguerin@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design:needed A design request has been raised that needs a proposal lib:http triaged:core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants