Sha256: aad86156ed61d7a203d97a8d2ea6a9c4ed8ec845ecb069d576509e41ff1a6e1a

Contents?: true

Size: 588 Bytes

Versions: 13

Compression:

Stored size: 588 Bytes

Contents

# *Flexirest:* Root elements

If your response comes back with a root node and you'd like to ignore it, you can define the mapping as:

```ruby
class Feed < Flexirest::Base
  post :list, "/feed", ignore_root: "feed"
end
```

Alternatively if you want to wrap your JSON request body in a root element, e.g.:

```json
{
  "feed": {
    "id": 1
  }
}
```

You can do it like this:

```ruby
class Feed < Flexirest::Base
  post :list, "/feed", wrap_root: "feed"
end

Feed.list(id: 1)
```


-----

[< Default parameters](default-parameters.md) | [Required parameters >](required-parameters.md)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
flexirest-1.7.8 docs/root-elements.md
flexirest-1.7.7 docs/root-elements.md
flexirest-1.7.6 docs/root-elements.md
flexirest-1.7.5 docs/root-elements.md
flexirest-1.7.4 docs/root-elements.md
flexirest-1.7.3 docs/root-elements.md
flexirest-1.7.2 docs/root-elements.md
flexirest-1.7.1 docs/root-elements.md
flexirest-1.7.0 docs/root-elements.md
flexirest-1.6.9 docs/root-elements.md
flexirest-1.6.8 docs/root-elements.md
flexirest-1.6.7 docs/root-elements.md
flexirest-1.6.6 docs/root-elements.md