{"action":"opened","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/nodejs-docs-samples/issues/282","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/nodejs-docs-samples","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/nodejs-docs-samples/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/nodejs-docs-samples/issues/282/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/nodejs-docs-samples/issues/282/events","html_url":"https://github.com/GoogleCloudPlatform/nodejs-docs-samples/issues/282","id":197058559,"number":282,"title":"security in openapi.yaml now needs to be under the method","user":{"login":"bshaffer","id":103941,"avatar_url":"https://avatars.githubusercontent.com/u/103941?v=3","gravatar_id":"","url":"https://api.github.com/users/bshaffer","html_url":"https://github.com/bshaffer","followers_url":"https://api.github.com/users/bshaffer/followers","following_url":"https://api.github.com/users/bshaffer/following{/other_user}","gists_url":"https://api.github.com/users/bshaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/bshaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bshaffer/subscriptions","organizations_url":"https://api.github.com/users/bshaffer/orgs","repos_url":"https://api.github.com/users/bshaffer/repos","events_url":"https://api.github.com/users/bshaffer/events{/privacy}","received_events_url":"https://api.github.com/users/bshaffer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-21T23:27:51Z","updated_at":"2016-12-21T23:27:51Z","closed_at":null,"body":"The following in [`openapi.yaml`](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/appengine/endpoints/openapi.yaml#L79) does not have effect anymore:\r\n\r\n```yaml\r\n# This section requires all requests to any path to require an API key.\r\nsecurity:\r\n- api_key: []\r\n```\r\n\r\nInstead it needs to be moved under the method (like in the [python sample](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/endpoints/getting-started/openapi.yaml#L35)):\r\n\r\n```yaml\r\npaths:\r\n  \"/echo\":\r\n    post:\r\n      description: \"Echo back a given message.\"\r\n      operationId: \"echo\"\r\n      produces:\r\n      - \"application/json\"\r\n      responses:\r\n        200:\r\n          description: \"Echo\"\r\n          schema:\r\n            $ref: \"#/definitions/echoMessage\"\r\n      parameters:\r\n      - description: \"Message to echo\"\r\n        in: body\r\n        name: message\r\n        required: true\r\n        schema:\r\n          $ref: \"#/definitions/echoMessage\"\r\n      security:\r\n      - api_key: []\r\n```\r\n\r\nsee [endpoints docs](https://cloud.google.com/endpoints/docs/restricting-api-access-with-api-keys-openapi#restricting_access_to_specific_api_methods) for more info.\r\n"}}
{"actor":{"display_login":"bshaffer"}}