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

APICenter Extension Initial Release #6918

Merged
merged 29 commits into from
Nov 29, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0437444
create extension, update examples, remove import/export commands
arpishahmsft Oct 27, 2023
f9b1893
import export spec inline and remove version from examples
arpishahmsft Nov 7, 2023
8d872cd
import export spec - remove redundant az
arpishahmsft Nov 7, 2023
599a6be
auto lro poller and check import spec size for inlne option via comma…
arpishahmsft Nov 7, 2023
0544d1f
import export spec using a json file, link to json and commandline
arpishahmsft Nov 8, 2023
2ef6c9e
import json with any encdoing, auto indent json on export
arpishahmsft Nov 10, 2023
6569552
quick add working, not apim import
arpishahmsft Nov 14, 2023
b109ecc
quick add - fix envId bug
arpishahmsft Nov 15, 2023
4401bda
export metadata schema to a file customized
arpishahmsft Nov 20, 2023
4d8c5da
exmples export schema and create env
arpishahmsft Nov 20, 2023
41d4ccc
move quick add in api and remove redundant exmaple unicode
arpishahmsft Nov 20, 2023
9a6d0dd
add tests
arpishahmsft Nov 22, 2023
dd5ee3e
update metadata schema and additional tests
arpishahmsft Nov 23, 2023
b68051e
Merge branch 'Azure:main' into feature-arpishah/25282500-Extension
arpishahmsft Nov 23, 2023
8437ff0
improve code style
arpishahmsft Nov 24, 2023
e9765af
Merge branch 'feature-arpishah/25282500-Extension' of https://github.…
arpishahmsft Nov 24, 2023
ace20d6
fix local linting issues
arpishahmsft Nov 27, 2023
adba54c
remove default from update
arpishahmsft Nov 27, 2023
3e684ec
style flake corrections
arpishahmsft Nov 28, 2023
83fae12
remove default ws value from workspace update
arpishahmsft Nov 28, 2023
0f77828
Added help for api register command
arpishahmsft Nov 28, 2023
22e8b3f
Add APIC Seevice name in global fille
arpishahmsft Nov 28, 2023
a1c1e99
fx flake style error
arpishahmsft Nov 28, 2023
5e13cd3
add readme for extension
arpishahmsft Nov 28, 2023
e6af95f
update title of readme
arpishahmsft Nov 28, 2023
acec155
one more linter error
arpishahmsft Nov 28, 2023
ca2baa3
updated log line and tests
arpishahmsft Nov 29, 2023
ea8db47
change print statement to logger
arpishahmsft Nov 29, 2023
0ceb053
use logger warning
arpishahmsft Nov 29, 2023
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
Prev Previous commit
Next Next commit
import json with any encdoing, auto indent json on export
  • Loading branch information
arpishahmsft committed Nov 10, 2023
commit 2ef6c9e3442d540313d3421d21540ec4ca99d2ae
9 changes: 7 additions & 2 deletions src/apic-extension/azext_apic_extension/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import sys
import requests
import os
import chardet

logger = get_logger(__name__)

Expand All @@ -41,7 +42,11 @@ def pre_operations(self):

# Load the JSON file
if args.source_profile:
with open(str(args.source_profile)) as f:
rawdata = open(str(args.source_profile), 'rb').read()
result = chardet.detect(rawdata)
encoding = result['encoding']

with open(str(args.source_profile), 'r', encoding=encoding) as f:
data = json.load(f)
if data:
value = json.dumps(data)
Expand Down Expand Up @@ -107,6 +112,6 @@ def writeResultsToFile(self, results, file_name):
if os.path.splitext(file_name)[1] == '.json':
if isinstance(results, str):
results = json.loads(results)
json.dump(results, f, indent=None, separators=(',', ':'))
json.dump(results, f, indent=4, separators=(',', ':'))
else:
f.write(results)