profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/SleepWalker/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Sviatoslav SleepWalker Ukraine, Kiev

caiogondim/logdown.js 1021

:pencil2: Debug utility with markdown support that runs on browser and server

SleepWalker/hoauth 59

yii-hoauth provides simple integration with social network authorisation lib Hybridauth in Yii.

SleepWalker/atom-jest-test-runner 3

Run your Atom package tests using jest

SleepWalker/atom-hooks 1

Execute commands depending on file path and editor events (e.g. save)

SleepWalker/hoauth-demo-site 1

The source code of http://hoauth.hamstercms.com/yii-user

SleepWalker/apollo-datasource-mongodb 0

Apollo data source for MongoDB

SleepWalker/async 0

Async utilities for node and the browser

SleepWalker/babel-plugin-react-intl 0

Extracts string messages from React components that use React Intl.

issue commentkovetskiy/mark

Custom config path option does not implemented despite it listed in README

@kovetskiy thank you, it works fine. Closing an issue

SleepWalker

comment created time in 17 days

issue closedkovetskiy/mark

Custom config path option does not implemented despite it listed in README

Hello,

There is the following line in README:

-c <file> — Specify configuration file which should be used for reading Confluence page URL and markdown file path.

but it looks like this option isn't parsed from command line.

It would be really cool to have such feature or at least remove this option from README.

closed time in 17 days

SleepWalker

issue commentkovetskiy/mark

Custom config path option does not implemented despite it listed in README

@kovetskiy can you please publish the latest version to docker registry? Currently there is 5.7 as the latest: https://hub.docker.com/r/kovetskiy/mark/tags?page=1&ordering=last_updated

SleepWalker

comment created time in a month

issue commentkovetskiy/mark

Custom config path option does not implemented despite it listed in README

It's not that convenient to store creds in home dir. Normally credentials are stored in a local file, e.g. .env (that also has a bonus feature of specifying creds view env vars).

But in my case using docker, I've just mounted local file to the home dir of container like so:

docker -v `pwd`/mark.config.toml:/root/.config/mark -v `pwd`:/docs --rm -i kovetskiy/mark:latest mark ...
SleepWalker

comment created time in a month

issue commentkovetskiy/mark

🔥 New feature: add support for mdx

I've successfully integrated mdx (react) with mark. There are still some little things to fix but it seems to work! I'm planning to publish my work as a separate package and gradually rewrite it to js

SleepWalker

comment created time in a month

PR opened fastify/fast-json-stringify

fix: resolve fragment $refs in nested objects (#350)

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/fastify/fastify/blob/master/CONTRIBUTING.md

By making a contribution to this project, I certify that:

  • (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

  • (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

  • (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

  • (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

Checklist

+64 -3

0 comment

2 changed files

pr created time in a month

create barnchSleepWalker/fast-json-stringify

branch : gh-350-fix-nested-schema-refs

created branch time in a month

push eventSleepWalker/fast-json-stringify

SleepWalker

commit sha a4c12df9bf443c0929677605023bfa2c40049b40

fix: resolve fragment $refs in nested objects (#350)

view details

push time in a month

issue commentfastify/fast-json-stringify

Error when resolving nested schema refs by id ({"$ref": "#foo"})

@Eomm I can not get whether it is valid to use definitions deeper in scheme (see #/properties/nested/definitions).

{
  "properties": {
    "nested": {
      "type": "object",
      "properties": {
        "firstName": {
          "$ref": "#foo"
        },
        "lastName": {
          "$ref": "#bar"
        }
      },
      "definitions": {
        "bar": {
          "$id": "#bar",
          "type": "number"
        }
      }
    }
  },
  "definitions": {
    "foo": {
      "$id": "#foo",
      "type": "string"
    }
  }
}

This validator does not allow such usage, but this allows

The spec does not state where it is allowed to put definitions


Another one thing is that theoretically I can define a new subschema everywhere by just adding an $id to it:

{
  "properties": {
    "nested": {
      "$id": "nested",
      "type": "object",
      "properties": {
        "firstName": {
          "$ref": "#foo"
        },
        "lastName": {
          "$ref": "#bar"
        }
      },
      "definitions": {
        "bar": {
          "$id": "#bar",
          "type": "number"
        }
      }
    }
  },
  "required": [
    "nested"
  ],
  "definitions": {
    "foo": {
      "$id": "#foo",
      "type": "string"
    }
  }
}

this example will pass both validators. But for me it looks like #foo should not be reachable because of adding $id (new base URI)

SleepWalker

comment created time in a month

issue closedfastify/fastify-swagger

An option to disable TopBar

<!-- Before you submit an issue we recommend you visit Fastify Help and ask any questions you have or mention any problems you've had getting started with Fastify.

Please read this entire template before posting any issue. If you ignore these instructions and post an issue here that does not follow the instructions, your issue might be closed, locked, and assigned the missing discussion label. -->

🚀 Feature Proposal

Let's provide an option to hide the needless Topbar:

image

According to this issue to remove topbar you need to modify swagger initialization js by removing SwaggerUIStandalonePreset from plugins and removing layout prop. Current fastify-swagger config does not allow such modifications

closed time in a month

SleepWalker

issue commentfastify/fastify-swagger

An option to disable TopBar

Sorry, the issue can be closed. I've found out that it is enough to set layout: 'BaseLayout' in ui config :sweat_smile: . Previously I've sought that SwaggerUIStandalonePreset must be removed as well.

fastify.register(require('fastify-swagger'), {
  // ...
  exposeRoute: true,
  uiConfig: {
    layout: 'BaseLayout'
  }
})
SleepWalker

comment created time in a month

fork SleepWalker/fastify-swagger

Swagger documentation generator for Fastify

fork in a month

issue openedfastify/fast-json-stringify

Error when resolving nested schema refs by id ({"$ref": "#foo"})

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure it has not already been reported

Fastify version

3.20.2

Plugin version

No response

Node.js version

v14.16.0

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

Ubuntu 20.04.2

Description

refFinder fails to find a $ref by $id, when the schema is nested, e.g.:

{
  "title": "Example Schema",
  "type": "object",
  "properties": {
    "nested": {
      "type": "object",
      "properties": {
        "firstName": {
          "$ref": "#foo"
        },
        "lastName": {
          "$ref": "#foo"
        }
      }
    }
  },
  "definitions": {
    "foo": {
      "$id": "#foo",
      "type": "string"
    }
  }
}

There are actually two errors:

  • if there is no externalSchema, you'll get TypeError: Cannot convert undefined or null to object when executing for (var key of Object.keys(externalSchema)) {
  • if externalSchema is specified, refFinder will fail to dereference $ref and a property will end up resolved to undefined which will trigger TypeError: Cannot read property 'type' of undefined on the later stages in buildCode

Looks like refFinder should look up for definitions starting from root instead of schema in the same way as it done for processing of #/definitions/foo refs.

Steps to Reproduce

const fastJson = require('fast-json-stringify');
const stringify = fastJson({
  title: 'Example Schema',
  type: 'object',
  properties: {
    firstName: { $ref: '#foo' },
    lastName: { $ref: '#foo' },
    nested: {
      type: 'object',
      properties: {
        firstName: { $ref: '#foo' },
        lastName: { $ref: '#foo' },
      },
    },
  },
  definitions: {
    foo: {
      $id: '#foo',
      type: 'string',
    },
  },
});

console.log(
  stringify({
    firstName: 'Matteo',
    lastName: 'Collina',
    nested: {
      firstName: 'Matteo',
      lastName: 'Collina',
    },
  }),
);

Expected Behavior

The nested $ref should be resolved. Here is an example of schema validation: https://www.jsonschemavalidator.net/s/sMCUkqfP

created time in a month

issue commentswagger-api/swagger-ui

Render query param examples as placeholders

This issue looks too simple to implement. Why is it still open? I can send PR if it is the only thing that missing in order to get the correct behavior.

@char0n, @shockey I don't know who is responsible to take further decisions. Can you suggest what should be next actions to get this feature released?

lucasmfredmark

comment created time in a month

issue commentfastify/fastify-swagger

An option to disable TopBar

@mcollina ok. Where is the better place to add a new config option: config.hideTopbar or it's better to use config.uiConfig.hideTopbar? The last one looks a better choice but according to docs it should contain only swagger-ui options

SleepWalker

comment created time in a month

issue openedfastify/fastify-swagger

An option to disable TopBar

<!-- Before you submit an issue we recommend you visit Fastify Help and ask any questions you have or mention any problems you've had getting started with Fastify.

Please read this entire template before posting any issue. If you ignore these instructions and post an issue here that does not follow the instructions, your issue might be closed, locked, and assigned the missing discussion label. -->

🚀 Feature Proposal

Let's provide an option to hide the needless Topbar:

image

According to this issue to remove topbar you need to modify swagger initialization js by removing SwaggerUIStandalonePreset from plugins and removing layout prop. Current fastify-swagger config does not allow such modifications

created time in a month

issue openedkovetskiy/mark

:fire: New feature: add support for mdx

Hello,

mdx is a markdown extension, that allows to use React inside md files. React components can be used to replace current approach with macros. As a result we will get much more flexible and customizable tool.

There is only one problem. Looks like mdx requires to add JavaScript in the mix, but I saw there are already go project that mixing in js parts: https://github.com/jxnblk/mdx-go. I'm not a go developer, so I don't know the best way to add mdx support inside go project.

If mdx support goes completely against current vision of mark development can I request another feature? It would be cool allow setting up "compiler" for files so that the mark will delegate md/mdx -> html conversion to some external command. In such way someone like me will be able to replace default md parsing with the custom one.

created time in a month

issue openedkovetskiy/mark

Support double star (**) glob syntax

Hello,

it turns out that default golang Glob function does not support common globstar (**) syntax. This syntax allows matching of files in subdirs too.

Here are some useful links:

  • https://stackoverflow.com/questions/26809484/how-to-use-double-star-glob-in-go
  • https://github.com/bmatcuk/doublestar

created time in a month

issue openedkovetskiy/mark

Custom config path option does not implemented despite listed in README

Hello,

There is the following line in README:

-c <file> — Specify configuration file which should be used for reading Confluence page URL and markdown file path.

but it looks like this option isn't parsed from command line.

It would be really cool to have such feature or at least remove this option from README.

created time in a month

startedrstacruz/nprogress

started time in 2 months

startedPhilippC/keepass2android

started time in 2 months

delete branch SleepWalker/fastify-response-validation

delete branch : 35-support-shortcut-schema-syntax

delete time in 2 months

Pull request review commentfastify/fastify-response-validation

35 support shortcut schema syntax

 test('Should return a validation error', async t => {   }) }) +test('Should support shortcut schema syntax', async t => {+  const fastify = Fastify()

Oh, I've seen that flag but I've thought that in order to support it, it should be added as a separate option for fastify-response-validation and that looked to me as unnecessary complication.

If we can inherit root fastify config it looks like a good addition. Should I submit a separate PR for that?

SleepWalker

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentfastify/fastify-response-validation

35 support shortcut schema syntax

 function validateResponse (fastify, opts, next) {   function buildHook (schema) {     const statusCodes = {}     for (const statusCode in schema) {-      statusCodes[statusCode] = ajv.compile(schema[statusCode])+      const responseSchema = schema[statusCode]+      statusCodes[statusCode] = ajv.compile(+        // replicate getSchemaAnyway from fastify+        // https://github.com/fastify/fastify/blob/23371945d01c270af24f4a5b7e2e31c4e806e6b3/lib/schemas.js#L113+        !responseSchema.type && !responseSchema.properties

I've copied an entire function from fastify

SleepWalker

comment created time in 2 months

PullRequestReviewEvent

push eventSleepWalker/fastify-response-validation

SleepWalker

commit sha 06d9975f1a0ad0fd9a5d8eba12301ccd7bc3b07f

chore: fix lint warnings

view details

SleepWalker

commit sha 7270af039b8577f5515bf3cfc2f53e749b741b74

feat: support shortcut schema definitions (#35)

view details

push time in 2 months

Pull request review commentfastify/fastify-response-validation

35 support shortcut schema syntax

 function validateResponse (fastify, opts, next) { }  function schemaErrorsText (errors) {-  var text = ''-  var separator = ', '-  for (var i = 0; i < errors.length; i++) {-    var e = errors[i]+  let text = ''+  const separator = ', '+  for (let i = 0; i < errors.length; i++) {

interesting :thinking:

SleepWalker

comment created time in 2 months

PullRequestReviewEvent