question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Method descriptors do not support variables

See original GitHub issue

Sorting

  • I’m submitting a …

    • bug report
    • feature request
    • support request
  • I confirm that I

    • used the search to make sure that a similar issue hasn’t already been submit

Current Behavior

we tried to reuse existing variable/const/enum in Method and Path but path end up as undefined in OpenAPI spec

enum aliases {
  TEST_ALIAS = 'test-alias',
}

@Route('/example/{exampleId}/test')
export class DeliverablesController extends Controller {
  @Put(aliases.TEST_ALIAS)
  public createOrUpdateTest(
  ): any {
    return {};
  }
}

Context (Environment)

Version of the library: 3.9.0 Version of NodeJS: 16

  • Confirm you were using yarn not npm: [x]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
WoHcommented, Aug 24, 2021

Roughly something like:


  it('should generate a path for a GET route with const argument', () => {
    verifyPath(baseRoute + 'path_from_constant');
  });

  it('should generate a path for a GET route with Enum argument', () => {
    verifyPath(baseRoute + 'path_from_enum');
  });

1reaction
WoHcommented, Aug 24, 2021

Your solution is in fact preferable, since I assumed (based on flawed memory) that we were already extracting the path via getDecoratorValues, which we didnt’t do. Ideally, you could add a test for the Enum example, so we cover that as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Descriptor HowTo Guide — Python 3.11.1 documentation
Descriptors let objects customize attribute lookup, storage, and deletion. This guide has four major sections: The “primer” gives a basic overview, ...
Read more >
15 Oracle Dynamic SQL: Method 4
Oracle Dynamic SQL Method 4 does not support object types, cursor variables, arrays of structs, DML returning clauses, Unicode variables, and LOBs.
Read more >
InvocableVariable Annotation | Apex Developer Guide
Use the InvocableVariable annotation to identify variables used by invocable methods in custom classes.
Read more >
Variables and Data Types
Variables are the nouns of a programming language: they are the entities (values, data) that act or are acted upon. The character-counting program...
Read more >
Variables reference - Visual Studio Code
Variables Reference. Visual Studio Code supports variable substitution in Debugging and Task configuration files as well as some select settings.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found