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

Adding required tag to a ref'd definition #272

Closed
robertdown opened this issue Jan 7, 2016 · 2 comments
Closed

Adding required tag to a ref'd definition #272

robertdown opened this issue Jan 7, 2016 · 2 comments

Comments

@robertdown
Copy link

Perhaps it is outside of the scope of the spec, but I am attempting to reference a definition as a parameter (body) and mark a field in the ref'd definition as required only in this specific context.

@SWG\Post(
     path="/stream",
     description="Create a new stream",
     @SWG\Parameter(
         in="body",
         name="body",
         @SWG\Schema(
             ref="#/definitions/Stream",
             required={"stream_id"}
         )
     ),

This would ideally render the Stream definition (which it does) and mark stream_id as required (which it is not). Expected behavior does occur when adding the required array to the definition object

@bfanger
Copy link
Collaborator

bfanger commented Jan 15, 2016

Using a ref combined with other properties is sadly not supported in the current spec.

@bfanger
Copy link
Collaborator

bfanger commented Feb 22, 2017

Should work since 2.0.8 (which includes #301 )

@bfanger bfanger closed this as completed Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants