Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: OpenAPI 3 Emitter failed to check type of termsOfService in @info #3885

Closed
4 tasks done
Tracked by #3836
skywing918 opened this issue Jul 18, 2024 · 0 comments
Closed
4 tasks done
Tracked by #3836
Labels
bug Something isn't working emitter:openapi3 Issues for @typespec/openapi3 emitter triaged:core
Milestone

Comments

@skywing918
Copy link
Member

skywing918 commented Jul 18, 2024

Describe the bug

@info decorator failed to check type for termsOfService.

tsp

import "@typespec/openapi";
import "@typespec/openapi3";

using TypeSpec.OpenAPI;

@info({
  termsOfService:"@asd"
})
@service({title: "My service"})
namespace PetStore;

Actual Specification

it don't show any warning/error if the termsOfService type is not url

openapi: 3.0.0
info:
  title: My service
  termsOfService: '@asd'
  version: 0.0.0
tags: []
paths: {}
components: {}

Expected Specification

image

openapi: 3.0.0
info:
  title: My service
  termsOfService: 'http://example.com'
  version: 0.0.0
tags: []
paths: {}
components: {}

Reproduction

  1. git clone https://github.com/skywing918/typespec-workaround.git
  2. tsp compile termsOfService.tsp
  3. Open /tsp-output/@typespec/openapi3 to get the result

Checklist

@skywing918 skywing918 added the bug Something isn't working label Jul 18, 2024
@skywing918 skywing918 changed the title [Bug]: OpenAPI 3 Emitter failed to check type of termsOfService in [Bug]: OpenAPI 3 Emitter failed to check type of termsOfService in @info Jul 18, 2024
@markcowl markcowl added the emitter:openapi3 Issues for @typespec/openapi3 emitter label Jul 22, 2024
@markcowl markcowl added this to the Backlog milestone Jul 22, 2024
github-merge-queue bot pushed a commit that referenced this issue Sep 27, 2024
…n @info (#4483)

[issue 3885](#3885)

---------

Co-authored-by: Kyle Zhang <[email protected]>
Co-authored-by: Timothee Guerin <[email protected]>
@wanlwanl wanlwanl closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working emitter:openapi3 Issues for @typespec/openapi3 emitter triaged:core
Projects
None yet
Development

No branches or pull requests

3 participants