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

/journeys earlierRef and laterRef can not be serialized #3

Closed
ghost opened this issue Dec 9, 2018 · 3 comments
Closed

/journeys earlierRef and laterRef can not be serialized #3

ghost opened this issue Dec 9, 2018 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Dec 9, 2018

earlierRef and laterRef are set as attributes of an array by hafas-client. It is impossible to serialize this format into JSON, as JSON arrays can not carry extra attributes.

Possible solutions:

  • Change the API in hafas-client to something like this:
{
    journeys: [
        [...]
    ],
    earlierRef: "[...]",
    laterRef: "[...]"
}
  • Or keep the API in hafas-client, but change it to the above in the rest wrapper
@ghost
Copy link
Author

ghost commented Dec 9, 2018

I implemented the second one here, but of course this would break the rest API:
https://github.com/petabyteboy/hafas-rest-api/commit/2b83bc2002a84c921a84943fc75ea6e0d0fba70f

@derhuerst derhuerst added the bug label Dec 10, 2018
@derhuerst
Copy link
Member

@derhuerst derhuerst reopened this Dec 10, 2018
@derhuerst
Copy link
Member

c3c7633 has adapted hafas-rest-api to hafas-client@4, which returns an object just like you proposed. Published as [email protected].

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

No branches or pull requests

1 participant