News for hackers. Stuff that matters.
Re:Write OpenAPI with TypeSpec by FourOnTheFloor on Thursday March 28, 2024 @02:48AM (#39848398)
Hadn't heard of that, thanks.

Does TypeSpec have description fields? I don't think I've seen any in the examples.

Re:Write OpenAPI with TypeSpec by bterlson on Thursday March 28, 2024 @03:03AM (#39848461)
The playground I posted has a description. They're pulled from JSDoc style comments. You can also use the `@doc` decorator, though that's usually reserved for more advanced cases like when you need string interpolation or something.
Re:Write OpenAPI with TypeSpec by FourOnTheFloor on Friday March 29, 2024 @04:23AM (#39861768)
Thanks. I don't see any in that playground though. Which document are they in? I think I looked in all the ones in the drop-down.
Re:Write OpenAPI with TypeSpec by bterlson on Friday March 29, 2024 @06:54PM (#39869904)
The link should load up with a sample I wrote, I think? It does for me anyway! Let me know if you don't see it. But I'll also paste it here:

    model Foo {
      /** this is a description */
      x: Bar;
    }

    /** this is also a description */
    model Bar {}
Re:Write OpenAPI with TypeSpec by FourOnTheFloor on Sunday March 31, 2024 @07:28PM (#39889226)
Thanks. Never having seen a description in this language, I wouldn't know that the above syntax designated one; it looks like a comment.

I also can't find any similar strings in any of the samples in the drop-down list.