Giter Club home page Giter Club logo

Comments (5)

cadir avatar cadir commented on August 18, 2024

Ended up adding the following code in server.go ServeHTTP to get this to work with local appengine dev server.

    var mapSrc, mapDest map[string]interface{}
    if err := json.Unmarshal(body, &mapSrc); err != nil {
        writeError(w, err)
        return
    }
    if _, found := mapSrc["resource"]; found && len(mapSrc) == 1 {
        c.Debugf("Exploding SPI request body")
        mapDest = mapSrc["resource"].(map[string]interface{})
        mapCopy := make(map[string]interface{})
        for k, v := range mapDest {
            mapCopy[k] = v
        }
        mapDest["resource"] = mapCopy
        if body, err = json.Marshal(mapDest); err != nil { // New body should have exploded resource object
            writeError(w, err)
            return
        }
    }

from go-endpoints.

x1ddos avatar x1ddos commented on August 18, 2024

Hey @cadir are you still seeing this issue? If so, could you post here your struct of the message, and if it's not too much trouble, the exact JSON payload a client is sending to the server?
Also, could you post full error of "Unmarshal by JSON"?

BTW, yes, it should handle both RPC and REST in the same way.

from go-endpoints.

x1ddos avatar x1ddos commented on August 18, 2024

@cadir are you sure the issue you're having is not the same as I described in #5?

from go-endpoints.

x1ddos avatar x1ddos commented on August 18, 2024

Closing for the lack of response. Please, reopen if needed. Better yet, send a PR if you find a bug.

from go-endpoints.

robskie avatar robskie commented on August 18, 2024

I think this is related to a known bug in the generated iOS Client here which only occurs in the development server.

from go-endpoints.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.