diff --git a/lib/api/v3/root.rb b/lib/api/v3/root.rb index e0f9df5f16..883f51c7d6 100644 --- a/lib/api/v3/root.rb +++ b/lib/api/v3/root.rb @@ -37,8 +37,11 @@ module API class Root < ::API::OpenProjectAPI helpers ::API::V3::Utilities::EpropsConversion - # All endpoint accept query props as gzipped and base64 encoded json objects before do + # Add Link header for openapi spec + header 'Link', '; rel="service-desc"' + + # All endpoint accept query props as gzipped and base64 encoded json objects transform_eprops end @@ -86,6 +89,10 @@ module API API::OpenAPI.spec end + get '/openapi.json' do + API::OpenAPI.spec + end + get '/spec.yml' do content_type 'text/vnd.yaml'