LiveRamp / reslang

A language for describing resource-oriented APIs & turning them into Swagger or resource diagrams. Oriented around the concepts we want to expose in the APIs.
Apache License 2.0
23 stars 7 forks source link

Parsing fails if /events used before /operations. #160

Closed njaczko closed 3 years ago

njaczko commented 3 years ago

Describe The Bug

/operations and /events only work when included in a specific order.

For example, this works fine:

"A test REST resource"
resource v2/TestResource {
    id: int

    /operations
        POST GET
    /events
        POST GET
}

However, this cannot be parsed:

"A test REST resource"
resource v2/TestResource {
    id: int

    /events
        POST GET
    /operations
        POST GET
}

Here's the error that gets produced:

Problem parsing file models/eventing/events.reslang: Expected "/*", "//", "DELETE", "GET", "PATCH", "POST", "PUT", "\"", "}", [ \t\r\n], or [a-z_] but "/" found., location: 33, 5

To Reproduce

  1. Use /events before /operations, as described above
  2. Attempt to generate AsyncAPI

Expected Behavior

/events and /operations can be parsed in any order.

Reslang Version

Master/Latest

njaczko commented 3 years ago

Resolved by https://github.com/LiveRamp/reslang/pull/164