My application stores two different types of json data in s3.

For example: Schema-Foo and Schema-Bar.

Up to now I used the content-type application/json for both.

I would like to make a distinction between both types in the s3 storage.

I am unsure what the best way would be.

Is it possible to do something like application/json-schema-foo application/json-schema-bar?

  • 1
  • Sure you can. Take a look to the 'vnd' definition. application/vnd+company.whatever+json – Laiv Jan 22 at 20:48
  • @Laiv you use application/vnd+company.whatever+json and User Hans-Martin Mosner uses application/json; schema=foo. Which one should I choose? – guettli Jan 23 at 10:26
  • 1
    Any, as soon as they meet your needs and introduce the less complexity possible. The @Hans-Martin' solution is probably the simplest. It's up to you to decide if that simplicity meet your needs. I would probably try his first. I just wanted you to have alternatives. – Laiv Jan 23 at 11:44

You might be able to use content-type parameters as in

application/json; schema=foo
application/json; schema=bar

I don't know whether adding user-defined parameters is officially blessed, but as long as you're talking between your own pieces of software who is going to punish you?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.