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

New field in links (method, headers, body) #1253

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

emmanuelmathot
Copy link
Collaborator

@emmanuelmathot emmanuelmathot commented Sep 27, 2023

Related Issue(s): #1198

Proposed Changes:

  1. Added method, headers, body fields in links objects

PR Checklist:

@emmanuelmathot emmanuelmathot changed the title Initial new field in links New field in links (method, headers, body) Sep 27, 2023
@emmanuelmathot emmanuelmathot added this to the 1.1 milestone Sep 27, 2023
Copy link
Collaborator

@m-mohr m-mohr left a comment

Choose a reason for hiding this comment

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

This looks generally good, but a couple of thoughts (for here and partially also the API):

  • headers: Shouldn't this be strictly just be a Map<string, string>?
  • body: Shouldn't this allow anything? Why is it only an object? Why can't it be a string or an array for example?
  • Should we have a central place where we define links so that it's not so repetitive?

@emmanuelmathot
Copy link
Collaborator Author

This looks generally good, but a couple of thoughts (for here and partially also the API):

  • headers: Shouldn't this be strictly just be a Map<string, string>?
  • body: Shouldn't this allow anything? Why is it only an object? Why can't it be a string or an array for example?

I used the same spec as per STAC API to be aligned since the initial issue was about being in line with STAC API.

  • Should we have a central place where we define links so that it's not so repetitive?

I moved link object definitions from item, catalog and collection to common metadata page

@m-mohr
Copy link
Collaborator

m-mohr commented Nov 9, 2023

I used the same spec as per STAC API to be aligned since the initial issue was about being in line with STAC API.

Maybe that's something we should actually bring up in the API and change there, too...

I moved link object definitions from item, catalog and collection to common metadata page

Not sure whether that's a good idea. That would need a broader change also in the schema as it implies links can now be used in Assets, Providers, Links itself, ... basically everywhere. I don't think that's intended.

| type | string | [Media type](../catalog-spec/catalog-spec.md#media-types) of the referenced entity. |
| title | string | A human readable title to be used in rendered displays of the link. |
| method | string | The HTTP method required to be supported by the target resource. `GET` by default |
| headers | object | The HTTP headers required to be sent by the target resource. |
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't use the object type in the spec, instead we use Map<string, *> (applies to headers and body for now)

Copy link
Collaborator

@m-mohr m-mohr Jun 3, 2024

Choose a reason for hiding this comment

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

headers: Map<string, string|array<string>>

{a: "b"}
translates to:
a: b

{a: ["b", "c"]}
translates to:

a: b
a: c

This could hopefully also be clarified in the STAC API spec.

body: Any type allowed

Also needs to be updated in the STAC API spec.

@m-mohr m-mohr linked an issue May 6, 2024 that may be closed by this pull request
@emmanuelmathot
Copy link
Collaborator Author

Discussion in STAC meetup: use Map<string, *> that is also an object and thus not break STAC API spec

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.

HTTP additions for links
2 participants