Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Unrecognized block causes regression in recognition of resource groups #124

Closed
Almad opened this issue Sep 25, 2015 · 3 comments
Closed
Labels

Comments

@Almad
Copy link
Contributor

Almad commented Sep 25, 2015

Given this blueprint:

FORMAT: 1A

# Regression Testing API

# Group Demonstration

## First Resource [/resource/first]

### POST

+ Properties

    + whatever (string) ... description

## Second Resource [/resource/second]

drafter 1.0 produces this output/AST:

arael-2:tmp almad$ drafter testast.apib
element: "category"
meta:
  classes:
    - "api"
  title: "Regression Testing API"
attributes:
  meta:
    -
      element: "member"
      meta:
        classes:
          - "user"
      content:
        key:
          element: "string"
          content: "FORMAT"
        value:
          element: "string"
          content: "1A"
content:
  -
    element: "category"
    meta:
      classes:
        - "resourceGroup"
      title: "Demonstration"
    content:
      -
        element: "resource"
        meta:
          title: "First Resource"
        attributes:
          href: "/resource/first"
        content:
          -
            element: "transition"
            meta:
              title: ""
            content: []
  -
    element: "category"
    meta:
      classes:
        - "resourceGroup"
      title: ""
    content:
      -
        element: "resource"
        meta:
          title: "Second Resource"
        attributes:
          href: "/resource/second"
        content: []

OK.
warning: (6)  action is missing a response :98:10
warning: (5)  ignoring unrecognized block :108:55
arael-2:tmp almad$

...which mistakenly puts second resource into dedicated, unnamed resource group, whereas original snowcrash properly nests it under original one:

arael-2:tmp almad$ snowcrash testast.apib
metadata:
- FORMAT: 1A
name: Regression Testing API
description:
resourceGroups:
- name: Demonstration
  description:
  resources:
  - uriTemplate: /resource/first
    name: First Resource
    description:
    object:
    methods:
    - method: POST
      name:
      description: "+ Properties\n\n    + whatever (string) ... description\n\n"
  - uriTemplate: /resource/second
    name: Second Resource
    description:
    object:

OK.
warning: (6)  no response defined for `POST /resource/first` :98:10
arael-2:tmp almad$

This looks to be caused by Properties changing the parser's idea of nesting levels.

@pksunkara
Copy link
Contributor

Did you mean to say "Unrecognized block causes regression in recognition of resource groups"?

@Almad
Copy link
Contributor Author

Almad commented Sep 26, 2015

@pksunkara yes, that is a fair point.

@Almad Almad changed the title Attributes block causes regression in recognition of resource groups Unrecognized block causes regression in recognition of resource groups Sep 26, 2015
@kylef kylef added the bug label Sep 27, 2015
@pksunkara
Copy link
Contributor

This is being tracked in #127

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants