xiaohutai / jsonapi

[Bolt Extension] JSON API for Bolt CMS
https://market.bolt.cm/view/bolt/jsonapi
MIT License
55 stars 18 forks source link

Merged repeater fields in attributes with two or more repeater fields in contenttype #29

Closed jimi75 closed 8 years ago

jimi75 commented 8 years ago

Bolt: 3.1.0 bolt/jsonapi: 3.0.3 php: 7

With two repeater fields in the same contentype the response merge the two fields in one.

Only occurs when you set the two fields in the field-list or when you get all the fields.

Raistlfiren commented 8 years ago

Can you please show the content type that you are using?

jimi75 commented 8 years ago
projectsen:
    name: Projects EN
    singular_name: Project EN
    fields: &projectsfields
        <<: *content
        <<: *highlights
        <<: *seo
        <<: *weight
        chart: 
            label: Chart values and labels
            type: repeater
            group: Chart
            limit: 4
            fields:
                value:
                    type: integer
                    min: 1
                    max: 10
                label:
                    type: text
        pdf:
            type: file
            label: Pdf file
            extensions: [ pdf ]
            group: PDF
        location:
            type: text
            class: large
            group: text
            required: true
            placeholder: 'City, Country'
        geolocation:
            type: geolocation
            group: geolocation
        heading: 
            type: integer
            min: 0
            max: 360
            group: geolocation
            postfix: 'The camera heading in degrees relative to true north. True north is 0°, east is 90°, south is 180°, west is 270°.'
        pitch:
            type: integer
            min: -90
            max: 90
            group: geolocation
            postfix: 'The camera pitch in degrees, relative to the street view vehicle. Ranges from 90° (directly upwards) to -90° (directly downwards).'
        homeweight:
            type: integer
            label: Home weight
            group: display
            postfix: 'Greater number show first | zero or negatives value dont show in home page'
    relations:
        clientsen:
            multiple: false
            label: Select a client
            order: name
    record_template: tpl/project.twig
    listing_template: tpl/projects.twig
    listing_sort: -weight
    sort: -weight
    default_status: draft

The include

highlights: &highlights
        highlights:
            label: Highlights
            type: repeater
            group: highlights
            limit: 10
            fields:
                title:
                    type: text
                description:
                    type: text
Raistlfiren commented 8 years ago

@jimi75 Please try the latest release - https://github.com/xiaohutai/jsonapi/releases/tag/3.0.5

Thanks!

jimi75 commented 8 years ago

@Raistlfiren Works perfectly!

You guys from all bolt universe are heroes!

Thanks!