Uploaded image for project: 'Usergrid (Retired)'
  1. Usergrid (Retired)
  2. USERGRID-94

NPE when creating relationships between entities with spaces in names

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • OLD
    • Stack

    Description

      I created two collections called "/cities" and "/countries", and inserted one entity into each. For "/countries"

      {
      action: "post"
      application: "c1518d80-44ba-11e3-83f9-1beebcb01927"
      params: {}
      path: "/countries"
      uri: "https://api.usergrid.com/fdsafdsa/sandbox/countries"
      entities: [1]
      0: {
      uuid: "7bf9c760-44c5-11e3-9437-393fabf0b04e"
      type: "country"
      name: "Andorra"
      created: 1383510073045
      modified: 1383510073045
      area: 468
      capitol: "Andorra la Vella"
      continent: "EU"
      currency: "EUR"
      currencyName: "Euro"
      fips: "AN"
      iso3CountryCode: "AND"
      isoCountryCode: "AD"
      isoNumeric: "020"
      languages: "ES,FR"
      metadata: {
      path: "/countries/7bf9c760-44c5-11e3-9437-393fabf0b04e"
      }-
      population: 84000
      tld: ".ad"
      }-
      -
      timestamp: 1383510073040
      duration: 127
      organization: "fdsafdsa"
      applicationName: "sandbox"
      }

      For "/cities":

      {
      action: "post"
      application: "c1518d80-44ba-11e3-83f9-1beebcb01927"
      params: {}
      path: "/cities"
      uri: "https://api.usergrid.com/fdsafdsa/sandbox/cities"
      entities: [1]
      0: {
      uuid: "01efcefa-44cb-11e3-89e9-fdf51fd9e7b3"
      type: "city"
      name: "lesEscaldes"
      created: 1383512445279
      modified: 1383512445279
      alternateNames: "Ehskal'des-Ehndzhordani,Escaldes,Escaldes-Engordany,Les Escaldes,esukarudesu=engorudani jiao qu,lai sai si ka er de-en ge er da,Эскальдес-Энджордани,エスカルデス=エンゴルダニ教区,萊塞斯卡爾德-恩戈爾達,萊塞斯卡爾德-恩戈爾達"
      asciiName: "les Escaldes"
      cc2: "08"
      countryCode: "AD"
      featureClass: "P"
      featureCode: "PPLA"
      geonameId: 3040051
      location: {
      latitude: 42.50729
      longitude: 1.53414
      }-
      metadata: {
      path: "/cities/01efcefa-44cb-11e3-89e9-fdf51fd9e7b3"
      }-
      population: 15853
      timeZone: "Europe/Andorra"
      }-
      -
      timestamp: 1383512445274
      duration: 96
      organization: "fdsafdsa"
      applicationName: "sandbox"
      }

      I then tried to create a "contains" relationship using:

      POST https://api.usergrid.com/fdsafdsa/sandbox/countries/Andorra/contains/cities/les Escaldes

      I got a 400 Bad Request back with the following payload:

      {
      error: "null_pointer"
      timestamp: 1383513044711
      duration: 0
      exception: "java.lang.NullPointerException"
      }

      The request works if I use the UUIDs or if I change the "les Escaldes" entry to not have a space in the name.

      Attachments

        Activity

          People

            malaka Malaka Mahanama
            rockerston Rod Simpson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: