Repository navigation
daytrader-go: rest - #6
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the JAX-RS address book (
daytrader3-ee6-rest:AddressBook,Address,AddressList,AddressBookDatabase) todaytrader-go/internal/features/rest/. Only that directory is touched.What was ported
GET /rest/addressesandGET /rest/addresses/search/{searchstring}(prefix match):{"addresses":[{entryName, zipCode, streetAddress, city, state, country}]},application/json. The bodies are byte-identical to Liberty's, including the list order (Entry4, Entry5, Entry2, Entry3, Entry1): the store keeps the legacyjava.util.HashMapiteration order (bucket, then insertion) so the order is fixed and the same./rest/addresses/{entryName}keeps the recorded quirk. It is a sub-resource locator ontoAddress.get, which is@Consumes text/xml | x-www-form-urlencoded,@Produces text/xml:Allow: HEAD, GET, OPTIONS(404 for an unknown entry).OPTIONSreturns the same WADL document, andAcceptthat excludes JSON on list/search is 406.app.Store.web.RegisterRestRoutewithout a method in the pattern, becausenet/http's own 405 has a body and a differentAllowheader.Parity
make parityprinted PASS for11-rest-list,12-rest-search,13-rest-entry:go-account,go-auth,go-infra,go-market(the siblings on origin at the time). In that combination 01, 02, 03, 08, 09, 10, 11, 12, 13 passed; 04 and 05 were DIFF and 06 and 07 ERROR (trading was not pushed yet; not this area).Legacy on Liberty was 13/13 on the same machine. Beyond the scenarios, 40 curl probes (methods,
Accept/Content-Typecombinations, trailing slashes, unknown paths) were diffed between:9083and:8080: status, body,Content-Type,AllowandContent-Languageare identical.Gates (as run):
gofmt -l .empty,go vet ./...clean,go test ./...ok (httptest unit tests in the rest package).docker buildandterraform validatewere not run; they are not part of this area.Differences from legacy
Content-Length: 0is not sent on 204 responses (Go'snet/httpomits it), and is sent on the HEAD 415 where Liberty omits it. NoX-Powered-By/Connection: Closeheaders.Scaffold requests
/{unmatched...}under the REST root so unknown/rest/*paths answer Liberty's empty 404 instead of Go's404 page not foundtext. No other area should register REST routes, so it cannot conflict.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/076ce1e56d8448778a35bbfff91ad70a
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/076ce1e56d8448778a35bbfff91ad70a?variant=devin
Requested by: @sumitshatwara