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

Standard Return types for each endpoint #135

Open
BryceStevenWilley opened this issue Jun 1, 2023 · 2 comments
Open

Standard Return types for each endpoint #135

BryceStevenWilley opened this issue Jun 1, 2023 · 2 comments

Comments

@BryceStevenWilley
Copy link
Collaborator

Now that I'm wrangling with now with ECF5, we will likely need to work with ECF 4 and ECF 5 jurisdictions at the same time, and IMO, it's a very bad idea to try to expect all of the client implementations to compare and convert between the two, especially when they don't know which jurisdiction is using which. Our proxy wouldn't be very useful if we just continued doing what we're currently doing and passing through either the XML or the JSON-ized version of the XML.

We're going to need to have a (hopefully) relatively simple standard that we can put all of the data that we're using from ECF 4 stuff on docassemble and put it in our own JSON data type, one per endpoint. It can be extensible in a python-dict sense, so if something the client is looking for is there, it can use it.

@BryceStevenWilley
Copy link
Collaborator Author

Some background discussion of other solutions considered before this in #27

@BryceStevenWilley
Copy link
Collaborator Author

Ran into a slight issue with the "python dict" method described above; certain responses are as JSON lists, and I can't add arbitrary attributes like processed_data to a list like that. That means we'll have to do things the hard way, by actually versioning the API. Hooray.

I do like how GitHub does their API, and they recently switched to a date version that's in a specific header. TBH, we don't need things to be date organized, but I do like the idea of a version string in a separate header (not trying to muck with Accepts, which TBH java makes it difficult to work with). So, if we get headers that include a "2" (only need the major version, not patch or minor, and trying to have clients pass that (do ppl want to pin a patch version? Do we want to support that?) would get complicated), then we can just send them the new object.

Testing will be a bit, but we can make some unit tests that take standard responses and make sure they can always be returned as is or as the new return type.

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

1 participant