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

Feature request: allow deeper view nesting in API Browser #377

Open
Talkless opened this issue Mar 16, 2023 · 2 comments
Open

Feature request: allow deeper view nesting in API Browser #377

Talkless opened this issue Mar 16, 2023 · 2 comments
Assignees

Comments

@Talkless
Copy link
Contributor

Currently, view names are spitted using '.' once:

package_name = package['name'].split('.')[0]

It might be useful to allow more then than single dot (or some other separator) for better code organization in bigger APIs.

For examples, if we have view names like this:

  • object.list.all
  • object.list.with_tacho_download_capability
  • object.report.trip_stop
  • object.report.time_in_zone
  • object.service.create
  • object.service.edit

We would see them nested in the API Browser like this:

image

@nycholas
Copy link
Member

Yes, it's pretty good.

My idea here is to create a schema definition for API Browser that allows setting the splitter character, like this:

browse = JSONRPCBrowe(splitter='.')

app = Flask('multiplesite')
jsonrpc_v1 = JSONRPC(app, '/api/v1', browse=browse)

Will it solve your use case?

@nycholas nycholas self-assigned this Mar 20, 2023
@Talkless
Copy link
Contributor Author

Looks good.

nycholas added a commit that referenced this issue Mar 25, 2023
The expected behavior is that when using the modular way, the API
Browser merges in one, instead of having one API Browser for each.

Now, the server is aware of the `SERVER_NAME` Flask configuration,
it is being used by API Browser to request the correct server,
besides that, the API Browser is able to call servers in different
domains. For that configuration, the `JSONRPCSite` generates the
`path` and `base_url` variables from `SERVER_NAME`, `APPLICATION_ROOT`,
and `PREFERRED_URL_SCHEME`.

It is the first step to providing a Browse Schema to improve
documentation and examples from API (JSON-RPC methods).

Resolves: #388
See: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 25, 2023
The expected behavior is that when using the modular way, the API
Browser merges in one, instead of having one API Browser for each.

Now, the server is aware of the `SERVER_NAME` Flask configuration,
it is being used by API Browser to request the correct server,
besides that, the API Browser is able to call servers in different
domains. For that configuration, the `JSONRPCSite` generates the
`path` and `base_url` variables from `SERVER_NAME`, `APPLICATION_ROOT`,
and `PREFERRED_URL_SCHEME`.

It is the first step to providing a Browse Schema to improve
documentation and examples from API (JSON-RPC methods).

Resolves: #388
See: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 25, 2023
The expected behavior is that when using the modular way, the API
Browser merges in one, instead of having one API Browser for each.

Now, the server is aware of the `SERVER_NAME` Flask configuration,
it is being used by API Browser to request the correct server,
besides that, the API Browser is able to call servers in different
domains. For that configuration, the `JSONRPCSite` generates the
`path` and `base_url` variables from `SERVER_NAME`, `APPLICATION_ROOT`,
and `PREFERRED_URL_SCHEME`.

It is the first step to providing a Browse Schema to improve
documentation and examples from API (JSON-RPC methods).

Resolves: #388
See: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 25, 2023
The expected behavior is that when using the modular way, the API
Browser merges in one, instead of having one API Browser for each.

Now, the server is aware of the `SERVER_NAME` Flask configuration,
it is being used by API Browser to request the correct server,
besides that, the API Browser is able to call servers in different
domains. For that configuration, the `JSONRPCSite` generates the
`path` and `base_url` variables from `SERVER_NAME`, `APPLICATION_ROOT`,
and `PREFERRED_URL_SCHEME`.

It is the first step to providing a Browse Schema to improve
documentation and examples from API (JSON-RPC methods).

Resolves: #388
See: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 25, 2023
The expected behavior is that when using the modular way, the API
Browser merges in one, instead of having one API Browser for each.

Now, the server is aware of the `SERVER_NAME` Flask configuration,
it is being used by API Browser to request the correct server,
besides that, the API Browser is able to call servers in different
domains. For that configuration, the `JSONRPCSite` generates the
`path` and `base_url` variables from `SERVER_NAME`, `APPLICATION_ROOT`,
and `PREFERRED_URL_SCHEME`.

It is the first step to providing a Browse Schema to improve
documentation and examples from API (JSON-RPC methods).

Resolves: #388
See: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 25, 2023
The expected behavior is that when using the modular way, the API
Browser merges in one, instead of having one API Browser for each.

Now, the server is aware of the `SERVER_NAME` Flask configuration,
it is being used by API Browser to request the correct server,
besides that, the API Browser is able to call servers in different
domains. For that configuration, the `JSONRPCSite` generates the
`path` and `base_url` variables from `SERVER_NAME`, `APPLICATION_ROOT`,
and `PREFERRED_URL_SCHEME`.

It is the first step to providing a Browse Schema to improve
documentation and examples from API (JSON-RPC methods).

Resolves: #388
See: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 25, 2023
The expected behavior is that when using the modular way, the API
Browser merges in one, instead of having one API Browser for each.

Now, the server is aware of the `SERVER_NAME` Flask configuration,
it is being used by API Browser to request the correct server,
besides that, the API Browser is able to call servers in different
domains. For that configuration, the `JSONRPCSite` generates the
`path` and `base_url` variables from `SERVER_NAME`, `APPLICATION_ROOT`,
and `PREFERRED_URL_SCHEME`.

It is the first step to providing a Browse Schema to improve
documentation and examples from API (JSON-RPC methods).

Resolves: #388
See: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 25, 2023
The expected behavior is that when using the modular way, the API
Browser merges in one, instead of having one API Browser for each.

Now, the server is aware of the `SERVER_NAME` Flask configuration,
it is being used by API Browser to request the correct server,
besides that, the API Browser is able to call servers in different
domains. For that configuration, the `JSONRPCSite` generates the
`path` and `base_url` variables from `SERVER_NAME`, `APPLICATION_ROOT`,
and `PREFERRED_URL_SCHEME`.

It is the first step to providing a Browse Schema to improve
documentation and examples from API (JSON-RPC methods).

Resolves: #388
See: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 25, 2023
The expected behavior is that when using the modular way, the API
Browser merges in one, instead of having one API Browser for each.

Now, the server is aware of the `SERVER_NAME` Flask configuration,
it is being used by API Browser to request the correct server,
besides that, the API Browser is able to call servers in different
domains. For that configuration, the `JSONRPCSite` generates the
`path` and `base_url` variables from `SERVER_NAME`, `APPLICATION_ROOT`,
and `PREFERRED_URL_SCHEME`.

It is the first step to providing a Browse Schema to improve
documentation and examples from API (JSON-RPC methods).

Resolves: #388
See: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 25, 2023
The expected behavior is that when using the modular way, the API
Browser merges in one, instead of having one API Browser for each.

Now, the server is aware of the `SERVER_NAME` Flask configuration,
it is being used by API Browser to request the correct server,
besides that, the API Browser is able to call servers in different
domains. For that configuration, the `JSONRPCSite` generates the
`path` and `base_url` variables from `SERVER_NAME`, `APPLICATION_ROOT`,
and `PREFERRED_URL_SCHEME`.

It is the first step to providing a Browse Schema to improve
documentation and examples from API (JSON-RPC methods).

Resolves: #388
See: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 27, 2023
It's very important to provide a safe way to change
the Web Browsable API in the next tasks.

See also: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 27, 2023
It's very important to provide a safe way to change
the Web Browsable API in the next tasks.

See also: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 27, 2023
It's very important to provide a safe way to change
the Web Browsable API in the next tasks.

See also: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 27, 2023
It's very important to provide a safe way to change
the Web Browsable API in the next tasks.

See also: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 29, 2023
It's very important to provide a safe way to change
the Web Browsable API in the next tasks.

See also: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 29, 2023
It's very important to provide a safe way to change
the Web Browsable API in the next tasks.

See also: #378, #377, #376, #374, #373, and #370
nycholas added a commit that referenced this issue Mar 29, 2023
It's very important to provide a safe way to change
the Web Browsable API in the next tasks.

See also: #378, #377, #376, #374, #373, and #370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants