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

add __deweb_info endpoint to server #256

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fleandrei
Copy link
Contributor

No description provided.

@fleandrei fleandrei changed the title add __deweb_info endpoint to server DRAFT add __deweb_info endpoint to server Mar 18, 2025
Copy link
Member

@thomas-senechal thomas-senechal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments
Also, I'm wondering if that should be merged before or after #250

Comment on lines 6 to 10
api/read/models/
api/read/restapi/operations/
api/read/restapi/embedded_spec.go
api/read/restapi/server.go
api/read/restapi/doc.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to put those files here
If the issue is that the format is not the same and so, it wants to be updated, simply generate and then run task fmt
There should only be the files that were modified because of the changes in the spec

type: string
version:
type: string
misc:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry but I still don't understand the point of this misc thing 🤷‍♂️
could you explain me what it will be used for ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use additionalProperties: true to allow properties not explicitely defined here to be present in the returned object. (maybe its even the default behaviour)

Comment on lines 36 to 39
Cors := cors.New(cors.Options{
AllowedMethods: []string{"GET"},
AllowOriginVaryRequestFunc: allowCorsOriginFunc,
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need that ?
If that's only for the dewebInfoPath, can't we move that in the handler directly ?

NetworkInfos msConfig.NetworkInfos
AllowList []string
BlockList []string
MiscPubliInfoJson string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MiscPubliInfoJson string
MiscPublicInfoJson string

APIPort int `yaml:"api_port"`
AllowList []string `yaml:"allow_list"`
BlockList []string `yaml:"block_list"`
MiscPublicInfoJson string `yaml:"misc_public_info"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, requesting for json inside of a yaml doesn't look like a good idea as the IDE's won't recognise the json inside of the yaml files and so won't be able to help users avoid errors
Users might make mistakes by using single or double quotes instead of single or double quotes etc, like, mixing formats in the same file is not a good idea
I would either make that a separate (and optional) json file, or parse as yaml and then make it to json

@fleandrei fleandrei linked an issue Mar 19, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add public info endpoint
3 participants