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

fix: API title created by register command is not same with provided spec #47

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/apic-extension/azext_apic_extension/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def register_apic(cmd, api_location, resource_group, service_name, environment_n
extracted_api_name = _generate_api_id(info.get('title', 'Default-API')).lower()
extracted_api_description = info.get('description', 'API Description')[:1000]
extracted_api_summary = info.get('summary', str(extracted_api_description)[:200])
extracted_api_title = info.get('title', 'API Title').replace(" ", "-").lower()
extracted_api_title = info.get('title', 'API Title')
extracted_api_version = info.get('version', 'v1').replace(".", "-").lower()
extracted_api_version_title = info.get('version', 'v1').replace(".", "-").lower()
# TODO -Create API Version lifecycle_stage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ interactions:
"kind": "rest", "license": {"name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html"},
"summary": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You
can find out more about\nSwagger at [http://swagger.io](http://swagger.io).
In the third iteration of the pet store, we''ve", "title": "swagger-petstore---openapi-3.0"}}'
In the third iteration of the pet store, we''ve", "title": "Swagger Petstore
- OpenAPI 3.0"}}'
headers:
Accept:
- application/json
Expand All @@ -34,19 +35,19 @@ interactions:
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30?api-version=2024-03-01
response:
body:
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"swagger-petstore---openapi-3.0","summary":"This
is a sample Pet Store Server based on the OpenAPI 3.0 specification. You
can find out more about\nSwagger at [http://swagger.io](http://swagger.io).
In the third iteration of the pet store, we''ve","description":"This is a
sample Pet Store Server based on the OpenAPI 3.0 specification. You can find
out more about\nSwagger at [http://swagger.io](http://swagger.io). In the
third iteration of the pet store, we''ve switched to the design first approach!\nYou
can now help us improve the API whether it''s by making changes to the definition
itself or to the code.\nThat way, with time, we can improve the API in general,
and expose some of the new features in OAS3.\n\nSome useful links:\n- [The
Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n-
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Swagger
Petstore - OpenAPI 3.0","summary":"This is a sample Pet Store Server based
on the OpenAPI 3.0 specification. You can find out more about\nSwagger at
[http://swagger.io](http://swagger.io). In the third iteration of the pet
store, we''ve","description":"This is a sample Pet Store Server based on the
OpenAPI 3.0 specification. You can find out more about\nSwagger at [http://swagger.io](http://swagger.io).
In the third iteration of the pet store, we''ve switched to the design first
approach!\nYou can now help us improve the API whether it''s by making changes
to the definition itself or to the code.\nThat way, with time, we can improve
the API in general, and expose some of the new features in OAS3.\n\nSome useful
links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n-
[The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)","kind":"rest","license":{"name":"Apache
2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocumentation":[],"contacts":[{"email":"apiteam@swagger.io"}],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30","name":"swaggerpetstore-openapi30","systemData":{"createdAt":"2024-05-08T09:06:18.4695316Z","lastModifiedAt":"2024-05-08T09:06:18.4695303Z"}}'
2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocumentation":[],"contacts":[{"email":"apiteam@swagger.io"}],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30","name":"swaggerpetstore-openapi30","systemData":{"createdAt":"2024-05-21T08:40:05.4281749Z","lastModifiedAt":"2024-05-21T08:40:05.4281734Z"}}'
headers:
api-supported-versions:
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview
Expand All @@ -57,9 +58,9 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 08 May 2024 09:06:18 GMT
- Tue, 21 May 2024 08:40:05 GMT
etag:
- d9036669-0000-0100-0000-663b408a0000
- 7a000511-0000-0100-0000-664c5de50000
expires:
- '-1'
pragma:
Expand All @@ -75,7 +76,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes:
- '1199'
x-msedge-ref:
- 'Ref A: 9D537846C08D4E178D95BFB0FFC8A3F9 Ref B: MAA201060514047 Ref C: 2024-05-08T09:06:16Z'
- 'Ref A: 31EC88B718064D179D0AA6A3D91CEB1A Ref B: MAA201060514029 Ref C: 2024-05-21T08:40:03Z'
x-powered-by:
- ASP.NET
status:
Expand Down Expand Up @@ -104,7 +105,7 @@ interactions:
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30/versions/1-0-19?api-version=2024-03-01
response:
body:
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"1-0-19","lifecycleStage":"design"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30/versions/1-0-19","name":"1-0-19","systemData":{"createdAt":"2024-05-08T09:06:21.1301365Z","lastModifiedAt":"2024-05-08T09:06:21.1301349Z"}}'
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"1-0-19","lifecycleStage":"design"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30/versions/1-0-19","name":"1-0-19","systemData":{"createdAt":"2024-05-21T08:40:09.7949725Z","lastModifiedAt":"2024-05-21T08:40:09.7949717Z"}}'
headers:
api-supported-versions:
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview
Expand All @@ -115,9 +116,9 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 08 May 2024 09:06:20 GMT
- Tue, 21 May 2024 08:40:09 GMT
etag:
- a6050b02-0000-0100-0000-663b408d0000
- d70277b0-0000-0100-0000-664c5de90000
expires:
- '-1'
pragma:
Expand All @@ -133,7 +134,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes:
- '1199'
x-msedge-ref:
- 'Ref A: 6D53DC791F2B4F40B0989118898D106D Ref B: MAA201060513027 Ref C: 2024-05-08T09:06:19Z'
- 'Ref A: 410902CC8A6B4884A92591867DF3C3EF Ref B: MAA201060513021 Ref C: 2024-05-21T08:40:08Z'
x-powered-by:
- ASP.NET
status:
Expand Down Expand Up @@ -178,7 +179,7 @@ interactions:
to the definition itself or to the code.\nThat way, with time, we can improve
the API in general, and expose some of the new features in OAS3.\n\nSome useful
links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n-
[The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30/versions/1-0-19/definitions/openapi","name":"openapi","systemData":{"createdAt":"2024-05-08T09:06:24.0718796Z","lastModifiedAt":"2024-05-08T09:06:24.0718789Z"}}'
[The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30/versions/1-0-19/definitions/openapi","name":"openapi","systemData":{"createdAt":"2024-05-21T08:40:14.3171419Z","lastModifiedAt":"2024-05-21T08:40:14.3171409Z"}}'
headers:
api-supported-versions:
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview
Expand All @@ -189,9 +190,9 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 08 May 2024 09:06:24 GMT
- Tue, 21 May 2024 08:40:13 GMT
etag:
- 7e048b2a-0000-0100-0000-663b40900000
- cd002ef8-0000-0100-0000-664c5dee0000
expires:
- '-1'
pragma:
Expand All @@ -207,7 +208,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes:
- '1199'
x-msedge-ref:
- 'Ref A: CC89692E462A4BDD807D743B37FE6514 Ref B: MAA201060514039 Ref C: 2024-05-08T09:06:22Z'
- 'Ref A: 5F1479CED8CD4FD8904D862EA34F2A43 Ref B: MAA201060516027 Ref C: 2024-05-21T08:40:12Z'
x-powered-by:
- ASP.NET
status:
Expand Down Expand Up @@ -659,7 +660,7 @@ interactions:
content-length:
- '0'
date:
- Wed, 08 May 2024 09:06:26 GMT
- Tue, 21 May 2024 08:40:25 GMT
expires:
- '-1'
pragma:
Expand All @@ -673,7 +674,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes:
- '1199'
x-msedge-ref:
- 'Ref A: 6BF3FEEBF89F49F991EFB3CEA6D67CD2 Ref B: MAA201060514033 Ref C: 2024-05-08T09:06:25Z'
- 'Ref A: 11A12FCF4F364C2EAEB4AB14100C56AA Ref B: MAA201060515009 Ref C: 2024-05-21T08:40:23Z'
x-powered-by:
- ASP.NET
status:
Expand All @@ -698,19 +699,19 @@ interactions:
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30?api-version=2024-03-01
response:
body:
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"swagger-petstore---openapi-3.0","summary":"This
is a sample Pet Store Server based on the OpenAPI 3.0 specification. You
can find out more about\nSwagger at [http://swagger.io](http://swagger.io).
In the third iteration of the pet store, we''ve","description":"This is a
sample Pet Store Server based on the OpenAPI 3.0 specification. You can find
out more about\nSwagger at [http://swagger.io](http://swagger.io). In the
third iteration of the pet store, we''ve switched to the design first approach!\nYou
can now help us improve the API whether it''s by making changes to the definition
itself or to the code.\nThat way, with time, we can improve the API in general,
and expose some of the new features in OAS3.\n\nSome useful links:\n- [The
Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n-
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Swagger
Petstore - OpenAPI 3.0","summary":"This is a sample Pet Store Server based
on the OpenAPI 3.0 specification. You can find out more about\nSwagger at
[http://swagger.io](http://swagger.io). In the third iteration of the pet
store, we''ve","description":"This is a sample Pet Store Server based on the
OpenAPI 3.0 specification. You can find out more about\nSwagger at [http://swagger.io](http://swagger.io).
In the third iteration of the pet store, we''ve switched to the design first
approach!\nYou can now help us improve the API whether it''s by making changes
to the definition itself or to the code.\nThat way, with time, we can improve
the API in general, and expose some of the new features in OAS3.\n\nSome useful
links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n-
[The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)","kind":"rest","lifecycleStage":"design","license":{"name":"Apache
2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocumentation":[],"contacts":[{"email":"apiteam@swagger.io"}],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30","name":"swaggerpetstore-openapi30","systemData":{"createdAt":"2024-05-08T09:06:18.4695316Z","lastModifiedAt":"2024-05-08T09:06:18.4695303Z"}}'
2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocumentation":[],"contacts":[{"email":"apiteam@swagger.io"}],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30","name":"swaggerpetstore-openapi30","systemData":{"createdAt":"2024-05-21T08:40:05.4281749Z","lastModifiedAt":"2024-05-21T08:40:05.4281734Z"}}'
headers:
api-supported-versions:
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview
Expand All @@ -721,9 +722,9 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 08 May 2024 09:06:29 GMT
- Tue, 21 May 2024 08:40:29 GMT
etag:
- d9038c69-0000-0100-0000-663b408d0000
- 7a002711-0000-0100-0000-664c5de90000
expires:
- '-1'
pragma:
Expand All @@ -737,7 +738,7 @@ interactions:
x-content-type-options:
- nosniff
x-msedge-ref:
- 'Ref A: FC386287292F4A44AE4ADA1BA7D50E66 Ref B: MAA201060515017 Ref C: 2024-05-08T09:06:28Z'
- 'Ref A: 63B6F3246770467782A3EB103AA411EB Ref B: MAA201060516027 Ref C: 2024-05-21T08:40:29Z'
x-powered-by:
- ASP.NET
status:
Expand All @@ -762,7 +763,7 @@ interactions:
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30/versions/1-0-19?api-version=2024-03-01
response:
body:
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"1-0-19","lifecycleStage":"design"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30/versions/1-0-19","name":"1-0-19","systemData":{"createdAt":"2024-05-08T09:06:21.1301365Z","lastModifiedAt":"2024-05-08T09:06:21.1301349Z"}}'
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"1-0-19","lifecycleStage":"design"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30/versions/1-0-19","name":"1-0-19","systemData":{"createdAt":"2024-05-21T08:40:09.7949725Z","lastModifiedAt":"2024-05-21T08:40:09.7949717Z"}}'
headers:
api-supported-versions:
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview
Expand All @@ -773,9 +774,9 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 08 May 2024 09:06:31 GMT
- Tue, 21 May 2024 08:40:32 GMT
etag:
- a6050b02-0000-0100-0000-663b408d0000
- d70277b0-0000-0100-0000-664c5de90000
expires:
- '-1'
pragma:
Expand All @@ -789,7 +790,7 @@ interactions:
x-content-type-options:
- nosniff
x-msedge-ref:
- 'Ref A: F8BAF52F0CAB4D878F051DAC62FBB0CD Ref B: MAA201060516017 Ref C: 2024-05-08T09:06:30Z'
- 'Ref A: 35EC52E8EA524290AE9E769BE369757D Ref B: MAA201060515051 Ref C: 2024-05-21T08:40:32Z'
x-powered-by:
- ASP.NET
status:
Expand Down Expand Up @@ -822,7 +823,7 @@ interactions:
to the definition itself or to the code.\nThat way, with time, we can improve
the API in general, and expose some of the new features in OAS3.\n\nSome useful
links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n-
[The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)","specification":{"name":"openapi","version":"3-0-2"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30/versions/1-0-19/definitions/openapi","name":"openapi","systemData":{"createdAt":"2024-05-08T09:06:24.0718796Z","lastModifiedAt":"2024-05-08T09:06:27.1757838Z"}}'
[The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)","specification":{"name":"openapi","version":"3-0-2"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore-openapi30/versions/1-0-19/definitions/openapi","name":"openapi","systemData":{"createdAt":"2024-05-21T08:40:14.3171419Z","lastModifiedAt":"2024-05-21T08:40:26.3223577Z"}}'
headers:
api-supported-versions:
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview
Expand All @@ -833,9 +834,9 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 08 May 2024 09:06:33 GMT
- Tue, 21 May 2024 08:40:36 GMT
etag:
- 7e04232b-0000-0100-0000-663b40930000
- cd0094f8-0000-0100-0000-664c5dfa0000
expires:
- '-1'
pragma:
Expand All @@ -849,7 +850,7 @@ interactions:
x-content-type-options:
- nosniff
x-msedge-ref:
- 'Ref A: E14722B8C2924505B65A82CDEBBED11F Ref B: MAA201060513029 Ref C: 2024-05-08T09:06:33Z'
- 'Ref A: D7D4EE21E8004FA7A15D5B4DFEBDC6DE Ref B: MAA201060514035 Ref C: 2024-05-21T08:40:35Z'
x-powered-by:
- ASP.NET
status:
Expand Down Expand Up @@ -1302,7 +1303,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 08 May 2024 09:06:36 GMT
- Tue, 21 May 2024 08:40:38 GMT
expires:
- '-1'
pragma:
Expand All @@ -1318,7 +1319,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-writes:
- '1199'
x-msedge-ref:
- 'Ref A: 46A9627CBBE6409E8F52AB91C2200402 Ref B: MAA201060515025 Ref C: 2024-05-08T09:06:35Z'
- 'Ref A: AB3B60598D52419B837FB9578B59542E Ref B: MAA201060515019 Ref C: 2024-05-21T08:40:37Z'
x-powered-by:
- ASP.NET
status:
Expand Down
Loading
Loading