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

Adding requests for mediatype #70

Open
ybbus opened this issue Oct 19, 2023 · 2 comments
Open

Adding requests for mediatype #70

ybbus opened this issue Oct 19, 2023 · 2 comments

Comments

@ybbus
Copy link

ybbus commented Oct 19, 2023

Currently it is not possible to retrieve / upload CAP defined mediatypes in the generated swagger ui. This would be a useful feature.

@chgeo
Copy link
Owner

chgeo commented Oct 19, 2023

Sounds interesting. Can you give an example?

@ybbus
Copy link
Author

ybbus commented Oct 19, 2023

entity Documents {
  key name            : String(64)
      description     : String(1024)
      data            : LargeBinary  @Core.ContentDisposition.Type: 'inline'  @Core.MediaType  : 'application/json'  @Core.ContentDisposition.Filename: 'data.json'
}

Creating an entity with this MediaTypes works like this

  1. Create the document
    POST /Documents
  2. Upload the data (not able to do that in swagger)
    PUT /Documents('myDocumentId')/data

Reading the data:
GET /Documents('myDocumentId')/data
Response:

  • Content-Type: application/json (since defined above)
  • Content-Disposition: inline; filename="data.json" (defined above)

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

No branches or pull requests

2 participants